finos / FDC3

An open standard for the financial desktop.
https://fdc3.finos.org
Other
203 stars 132 forks source link

FDC3 for Web Browsers Discussion group 18th July 2024 #1267

Closed kriswest closed 3 months ago

kriswest commented 4 months ago

Group overview

Group convened to discuss how to enable FDC3 use in a web browser, without the use of a browser extension (such as fdc3-desktop-agent or a container).

Issue: https://github.com/finos/FDC3/issues/896 Mailing list discussion: https://groups.google.com/a/finos.org/g/fdc3/c/jCvlLjokBLs

In a recent email on the FDC3 mailing list, @kriswest wrote:

... I also want to add that there is clearly significant interest in the community in enabling FDC3 use on the web. There is a strong use case in that it would enable better onboarding journeys with less drop-off (where you use an app on the web with others before adopting a desktop container or similar).

and:

But there are also additional challenges such as how to make the API available reliably without importing a proprietary module from a particular vendor into every app, how to deal with more than one implementation of API/Desktop Agent in the browser at once, how to do this reliably and securely within the browser sandbox etc.. Work needs to be done in the Standard to solve these issues and to make web browser use possible in a future FDC3 Standard version - which I believe is possible (and likely to involve using a vendor-agnostic FDC3 NPM module to detect and connect to API implementation(s)). However, we're going to need to do that work to enable the aforementioned API implementations to be compliant and if we fail to hold the line now on compliance with the current version of the FDC3 Standard, that may never happen.

Shared doc with current draft: https://tick42-my.sharepoint.com/:w:/g/personal/finsemble_datastore_interop_io/EZ0dfTCdRlJCnIF3C_1Oit0BF3fsXyvlMbisXp722DC9Kg?e=H2y7fn

Relevant issue tags

Current open issues that relate to the above concepts with the label: image

Meeting Date

Thursday 18 July 2024 - 11am (US eastern timezone EST) / 4pm (London, BST)

Zoom info

Meeting notices

Participation Requirements

Note: Meeting participants are expected to accept the terms of the FDC3 license (Community Specification License), understand the governance process and have a CLA in place.

Please click the following links at the start of the meeting if you have not done so previously.

Tracking Attendance

Note: Meeting participants are expected to add a comment to this GitHub issue in order that we can track attendance of FDC3 project meetings. Please do this at the start of the meeting.

Agenda

Minutes

Action Items

Rolled over and/or still in progress:

Untracked attendees

Full name Affiliation GitHub username
Roaders commented 4 months ago

Giles Roadnight / Morgan Stanley

robmoffat commented 4 months ago

Rob Moffat / FINOS 💯

paulgoldsmith commented 4 months ago

Paul Goldsmith / Morgan Stanley

kriswest commented 4 months ago

Kris West / interop.io 🚀

novavi commented 4 months ago

Derek Novavi / S&P Global

Davidhanson90 commented 4 months ago

David Hanson / Morgan Stanley

openfin-johans commented 4 months ago

Johan Sandersson / Here (formerly OpenFin) 🎁

pvoznyuk commented 4 months ago

Pavlo Vozniuk @ RBC CM

Lecss commented 4 months ago

Alex Dumitru / Citi

robmoffat commented 4 months ago

There wasn't time for discussion of this in the meeting:

Please jump on the comments and make your thoughts known!

kriswest commented 4 months ago

@Roaders @Davidhanson90 @robmoffat @Lecss I've just noticed that the messages are missing the new addEventListener API call that was added to 2.2 in issue https://github.com/finos/FDC3/issues/1136. I've added that to the set in 77f00232daffb39cd39ac88483ae3b9dda3b8eb1

Roaders commented 4 months ago

thanks for the heads up

kriswest commented 4 months ago

@Roaders @Davidhanson90 @robmoffat @Lecss @novavi @robmoffat pointed out an interesting issue with addContextListener and joinChannel. In the Desktop Agent API. Some background:

(User Channels) When you add a context listener and are already joined to a channel, or when you've added a context listener and then join a channel/switch channel you immediately receive the current context of that channel (this is important as the user can often change the channel with a channel selector, the app is not necessarily involved in that change and needs to be given the new context automatically).

(App Channels) This differs from the Channel API where you retrieve a channel object (fdc3.getOrCreateChannel) then add a context listener to it - you do NOT receive any automatic copies of the current context - instead you may call channel.getCurrentContext to manually retrieve it.

For the former case, I had been thinking that the Desktop Agent needs to send you a BroadcastEvent to give you the context for the newly added listener or newly joined channel - but that won't work as you can add multiple listeners to a channel (with the same or different types) and in some cases only the listener you just added should receive the message.

One suggestion to resolve the issue is to have joinUserChannelResponse and addContextListenerResponse contain the data when it needs to be sent over. However, as we use addContextListenerRequest/Response for both user and app channel request and it matters whether you are already joined to a channel or not I don't think this is ideal.

Instead, I think we should have the client code handle the situation by calling getCurrentContext itself on the current channel after a join or addContextListener (with null channelId - i.e. current user channel) so that it can send the auto-broadcast to the appropriate listener. For a joinUserChannel call it will already know the channel id, for addContextListener it will either need to query the current channel or be tracking that (which it needs to do for the channel selector anyway).

Thoughts? I think the second approach is going to be simpler to understand and will solve the issue for all DA implementations using getAgent, which will reduce (accidental/non-conformant) variation between implementations.

kriswest commented 4 months ago

Note that if the Desktop agent handles the channel selector - i.e. the channel changes for any reason other than a call to joinUserChannel by the app, then the Desktop Agent should sen broadcast events OR we ensure that the client code finds out and makes getCurrentContext requests itself... Either way, we will needed a documented approach that all DAs conform to...

Roaders commented 4 months ago

I see that there are a few possible solutions to this (if I understand the problem correctly)

I think that options 2 and 3 are implementation details and agent implementors can choose to go down either of these routes. I think that I would probably prefer option 1 - adding an optional currentContext property to the response message payload. This would cut down the number of messages and async awaits that we need in our code.

kriswest commented 4 months ago

Re: option 1 - its more awkward in that the context can be sent either when joining OR when adding a context listener, which ever comes second and after a context has been broadcast to the channel. Hence, two different messages to add a response to, one of which has multiple modes already.

Re: option 2 - we'd have to modify the broadcast message in some way so its clear which listener its intended for. With any normal broadcast it should be passed to all matching listeners. However, here you might have one listener already, a second is added and only the second should receive the broadcast.

We do need to decide on this in the Standard as the client code is standardized meaning that DAs need to work in the same way.

Hence, my preference for option 3 as it doesn't have multiple modes or make other exchanges more complex to understand (by introducing optional properties that are only used in certain cases). The additional complexity is light and implemented in the client code, so it doesn't have to be implemented by every DA (reducing the likelihood of variation and reducing the amount of docs required to explain it).

Roaders commented 4 months ago

yup, I am happy with option 3.

robmoffat commented 4 months ago

One slight nit is that getCurrentContext only returns a single item of context currently. We would need to change it so it returns the complete channel state.

kriswest commented 4 months ago

@robmoffat You don't need it to return the whole channel state in most cases, only the state for the listener you are adding (on addContextListener calls and if already joined to a channel) or listeners that have been added (on a joinUserChannel call). It's rare (in my experience) that there are more than one or two and there is no defined order so you can simply call getCurrentContext for each listener thats reelvant then fire the appropriate handler when/if you get the response with context in it. Code should be pretty clean and simple for that.

robmoffat commented 4 months ago

OK, so thinking this through:

I thought it was the latter but if the former that works fine

kriswest commented 4 months ago

Each listener only has one type filter which can be null (the most recent context of any type) or a specific type (most recent context of that type). The type argument and behaviour are an exact match between addContextListener and getCurrentContext - basically the auto-broadcast of the most recent context in user channels is an automated call to getCurrentContext which passes the result to the content handler.

i.e. its the former @robmoffat (filtered by the type of the listener)