Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardise auto-receipt of current context on join/addContextListener in DesktopAgent and Channel #511

Closed
kriswest opened this issue Nov 23, 2021 · 1 comment
Labels
channels feeds & transactions Channels, Feeds & Transactions Discussion Group enhancement New feature or request

Comments

@kriswest
Copy link
Contributor

kriswest commented Nov 23, 2021

Enhancement Request

According to the FDC3 API spec:

When an app joins a channel it will automatically recieve the current context for that channel.

https://fdc3.finos.org/docs/api/spec#joining-channels

We take that to mean that the current context of the channel will be auto-broadcast to the app when it joins the channel with context listeners already set (last context for an un-typed listener, last context of the specific type for a type listener), or when it adds a context listener.

n.b. assume a context has already been broadcast to the channel in each case below

fdc3.addContextListener(null, console.log);
fdc3.joinChannel("someSystemChannel");
// last context broadcast to the channel should be logged immediately
fdc3.addContextListener("fdc3.contact", console.log);
// last fdc3.contact context broadcast to the channel should be logged immediately

This is not the case for Channels, where you have to manually retrieve the context

let channel = await fdc3.getOrCreateChannel("someChannel");
channel.addContextListener(null, console.log);
//nothing is received initially until a new context is broadcast
let context = await channel.getCurrentContext();

We've found that this difference can be confusing for developers using the API. It also introduces complexity in implementing the DesktopAgent/Channel API that may be unnecessary (and the requirement is easy to miss in the spec).

To resolve, we suggest that the current context of a channel should be received automatically when adding a context listener and that this detail should be added to the documentation of the addContextListener functions (in both APIs).

@kriswest kriswest added enhancement New feature or request needs-pr channels feeds & transactions Channels, Feeds & Transactions Discussion Group labels Nov 23, 2021
@kriswest kriswest changed the title difference in auto-broadcast behaviour on between DesktopAgent and Channel is confusing Standardise auto-receipt of current context on join/addContext listener behaviour in DesktopAgent and Channel Nov 23, 2021
@kriswest kriswest changed the title Standardise auto-receipt of current context on join/addContext listener behaviour in DesktopAgent and Channel Standardise auto-receipt of current context on join/addContextListener in DesktopAgent and Channel Nov 23, 2021
@kriswest kriswest removed the needs-pr label Nov 23, 2021
@kriswest
Copy link
Contributor Author

Agreed to close at meeting:

  • Standard WG Meeting - April 28, 2022 #683
    While inconsistency is bad, auto-broadcast on user channels is popular there are use cases for not receiving the current context on adding a listener to an app channel (and while an app can retrieve current context it can't stop itself doing so if we make this change, preventing implementation of those use cases).

kriswest added a commit that referenced this issue Nov 28, 2022
…istener is added

Small addition to one of the app channel tests - we need to confirm that App Channels, listened to via the Channel interface do not auto-replay context messages (as System/User channels listened to through the fdc3/Desktop Agent interface do).

A different PR adds this to the 1.2 test cases.

Background:

The Standards Working Group re-affirmed under issue #511 at meeting #683 that the difference in the behaviour of the fdc3/DesktopAgent and Channel interfaces was intentional and necessary to implement certain use cases with App Channels. It was decided that this would not change in FDC3 2.0, hence it remains the case in 2.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channels feeds & transactions Channels, Feeds & Transactions Discussion Group enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant