Open hellosmithy opened 2 months ago
@hellosmithy Many thanks for the detailed write up. This was previously considered under issue #301, and has subsequently been raised as a question in a meeting at least once. Hence, I believe this is worth revisiting and I propose to do so at the May SWG meeting.
I've updated the above proposal to reflect the discussion from the last WG
Many thanks @hellosmithy!
Enhancement Request
NOTE: Edited to reflect discussion from Standard WG Meeting - May 23rd, 2024 #1215
Use Case:
Enable explicit clearing of individual contexts including within multi-context channels. For instance, removing a filter from a data grid (e.g., by instrument, trade, or time range) while keeping other context filters intact.
Current Limitations:
Additional Information
The issue of context clearing was most recently discussed at the #1215 Standard WG Meeting and several possible solutions were floated.
fdc3.nothing
to include an optionalsubType
field to indicate a specific contextclearContext
channel methodid
fields to indicate a cleared contexttype
param or by adding thetype
to the existingmetadata
paramNo decision was made, but there was general consensus that any solution would need to address both requirements of:
currentContext
state in the desktop agent*
and individual context listenersProposed Solution
A combination of the first two options would address both the above requirements.
Extend
fdc3.nothing
contextsubType
is not provided it represents a lack of context as per the existing behaviour.subType
is provided it indicates the lack of the specified context.E.g.
Addition of a
Channel.clearContext
methodFunctionality:
getCurrentContext
will receive anull
value for the cleared context typefdc3.nothing
context typesubType
is providedsubType
is omittedNOTE: Any direct listeners to the cleared
subType
would not receive any updates as the existing type contract expects that they would only get updates of the context being cleared. As such any consuming application would need to explicitly opt-in to context clearing updates with a separate listener offdc3.nothing
contexts.E.g.
Rationale for Hybrid Approach
clearContext
method directly updates the FDC3 internal context state in a declarative way that matches existing methods.fdc3.nothing
with asubType
allows context listeners to opt-in to receive specific contexts that have been cleared, without requiring major breaking changes to existing context listenersSome trade-offs:
Some edge cases:
fdc3.nothing
withsubType
is broadcast directly rather than triggered by a call toclearContext
? Would the internal context still be cleared?