-
Notifications
You must be signed in to change notification settings - Fork 167
Allow apps to decide if they receive their own broadcast messages #1751
Description
Enhancement Request
Remove the recommendation that Desktop Agents don't deliver messages back to the sender and let the app implementor decide if they wish to receive them or not.
Use Case
The FDC3 Standard recommends (SHOULD) that DAs don't deliver broadcast messages back to the sender, as it forces some apps to examine context sharing messages before applying them, just to check if they came from themselves. This can / was observed to cause flickering issues in a variety of apps when they changed context, broadcast that context, and immediately received a message back and reapplied the same context.
DesktopAgent implementations SHOULD ensure that context messages broadcast to a channel by an application joined to it are not delivered back to that same application.
See:
- https://fdc3.finos.org/docs/api/ref/DesktopAgent#broadcast
- https://fdc3.finos.org/docs/api/spec#desktop-agent-api-standard-compliance
Since then use cases have popped up for apps, composed of multiple widgets in the same page, to receive their own messages so that they can communicate with each other in the same way that they do other apps. This proposal doesn't solve routing of intents to handlers in the same app, but would make context sharing easier.
Additional Information
Back when this was added to FDC3 (in FDC3 1.2, see #285) the only way to determine if you sent a message, was to do a deep comparison of the context message + assume no one else would send an identical one (there are few small use cases where it makes to resend a message - such as to reset a view).
With the metadata changes proposed for FDC3 3.0 (#1728) that comparison is no longer necessary, as we can simply check if the source of the broadcast was this app instance (compare instanceId). That would allow an argument to getAgent to control whether an app receives its own messages (for FDC3 for web implementation, and potentially preload implementation, either by patching the addContextListener function or passing the argument to the DA somehow).