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

updated spec with more detailed explanation of the 'default' channel #168

Merged
merged 1 commit into from Feb 27, 2020

Conversation

nkolba
Copy link
Contributor

@nkolba nkolba commented Feb 7, 2020

addressing questions raised in #118

The one exception is the `default` channel. Because apps are automatically added to the `default` channel, the message routing behavior is different in order to prevent poor user experiences from unexpected context behavior. The behavior for the `default` channel is:

- All broadcasts (`fdc3.broadcast` when the app is on default, or `default.broadcast`) update the `default` context
- `fdc3.addContextListener` will NOT receive context events when the app is joined to the `default` channel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind this, but it is kind of unexpected behaviour, so we should be really clear that this is the case, and discuss it with the API working group.

It is also different from how broadcast and addContextListener worked in version 1.0, so we should clarify that this is a breaking change, and consider making the version 2.0.0 instead of 1.1.0 to indicate this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely this is significant and needs to be vetted by the WG. I'm OK with adding language calling out that this may be a breaking change for some (or event many) 1.0 implementations. However, I don't believe that this is a breaking change for the spec requiring a 2.x designation - since the 1.0 spec intentionally leaves this behavior open-ended.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider an simple application on 1.0 without any UI/frame/functionality for channels and all it does it fdc3.broadcast and fdc3.addContextListener.
Can it move to 1.1 without changing code and work as expected? Based on the above, the app would stop receiving any context but it can still send context on default channel. Is that correct? That seems confusing.

I think the difference in behavior of fdc3.addContextListener and fdc3.broadcast around default channel is confuisng.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my apps have just following two calls in their code base:
fdc3.broadcast and fdc3.addContextListener. They know nothing about being in a channel or not (which I think is very important).
I have a frame around that does channel management.
My apps can be in that custom frame (where they get channels) or in regular DesktopAgent/Windows frame (where there is no channels).

If I am understanding it correctly, basically any platform that doesn't implement Channels API, is useless for interop purposes because they can send stuff but not receive.

@@ -150,10 +150,36 @@ The 'system' channels include a 'default' channel which serves as the backwards
### Joining Channels
Apps can join channels. An app can only be joined to one channel at a time. When an app joins a channel it will automatically recieve the current context for that channel, except if the channel joined is the 'default'.

When an app is joined to a channel, calls to fdc3.broadcast and listeners added through fdc3.addContextListener will be routed to that channel. If an app is not explicitly joined to a channel, it is on the 'default' channel. It is up to the desktop agent to determine the behavior of the 'default' channel, and if context is automaticaly broadcast over it or not.
When an app is joined to a channel, calls to fdc3.broadcast and listeners added through fdc3.addContextListener will be routed to that channel. If an app is not explicitly joined to a channel, it is on the 'default' channel.
The `default` channel has special behavior that makes it different from other channels. See a detailed description [below](#default-channel-behavior).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The special behaviour of the default channel should also be documented clearly in the API documentation, not only in the spec, as people are more likely to read the docs than the whole spec.

The spec doesn't clarify if the default channel is returned by getSystemChannels?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed about updates to the API docs - will do.

Re: getSystemChannels - there is definitely a gap here. There are arguments either way - would be great to get the opinions of others who have already built or are using channel linking today.

@rikoe rikoe added the api FDC3 API Working Group label Feb 9, 2020
Copy link

@nicholasdgoodman nicholasdgoodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have one "language" comment below which seems to be causing some confusion.

I suppose this begs the question: why is the default channel special at all in the first place? Isn't this a case where "less is more"?

Implementors which want to treat the default channel specially (such as ignoring context updates or not taking the state upon joining) are free to do so.

The one exception is the `default` channel. Because apps are automatically added to the `default` channel, the message routing behavior is different in order to prevent poor user experiences from unexpected context behavior. The behavior for the `default` channel is:

- All broadcasts (`fdc3.broadcast` when the app is on default, or `default.broadcast`) update the `default` context
- `fdc3.addContextListener` will NOT receive context events when the app is joined to the `default` channel

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line in particular needs clarification or rewording, mostly because the phrase "when the app is joined" itself is ambiguous. This can be interpreted as:

  • Context listeners will not receive a context updated event at the moment the channel is joined
  • Context listeners will not receive context updated events while the channel is joined

@nkolba
Copy link
Contributor Author

nkolba commented Feb 12, 2020

@vmehtafds @nicholasdgoodman @rikoe I've made a new PR here that takes a different approach to resolving these issue. Please you please review and add your feedback?

thanks!

@nkolba nkolba merged commit 099930e into finos:master Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api FDC3 API Working Group cla-present
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants