Make raiseIntent context argument optional - #1983
Conversation
✅ Deploy Preview for fdc3 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1983 +/- ##
=======================================
Coverage 95.03% 95.03%
=======================================
Files 73 73
Lines 4251 4252 +1
Branches 596 597 +1
=======================================
+ Hits 4040 4041 +1
Misses 211 211 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
277eea1 to
07aaa53
Compare
07aaa53 to
b925adb
Compare
b925adb to
0b75945
Compare
|
agreement given to merge in #2153 . need re-approval to be able to merge |
kriswest
left a comment
There was a problem hiding this comment.
Need to add the new MUST to the conformance section for DAs that inject the API as it won't be handled for them by the agent-proxy.
| If a target app for the intent cannot be found with the criteria provided or the user either closes the resolver UI or otherwise cancels resolution, the promise MUST be rejected with an `Error` object with a `message` chosen from the [`ResolveError`](Errors#resolveerror) enumeration, or (if connected to a Desktop Agent Bridge) the [`BridgingError`](Errors#bridgingerror) enumeration. If a specific target `app` parameter was set, but either the app or app instance is not available, the promise MUST be rejected with an `Error` object with either the `ResolveError.TargetAppUnavailable` or `ResolveError.TargetInstanceUnavailable` string as its `message`. If an invalid context object is passed as an argument the promise MUST be rejected with an `Error` object with the [`ResolveError.MalformedContext`](Errors#resolveerror) string as its `message`. | ||
|
|
||
| If you wish to raise an intent without a context, use the `fdc3.nothing` context type. This type exists so that apps can explicitly declare support for raising an intent without context. | ||
| If you wish to raise an intent without a context, the `context` argument may be omitted (or `null`/`undefined` passed). In this case the Desktop Agent MUST substitute the `fdc3.nothing` context type, which apps may use to explicitly declare support for raising an intent without context. A `{ type: "fdc3.nothing" }` context may also be passed explicitly. |
There was a problem hiding this comment.
As there's a must here it needs adding to the DA conformance requirements section:
https://fdc3.finos.org/docs/next/api/spec#desktop-agent-api-standard-compliance
Line 96 in 0b75945
The context argument of raiseIntent is now optional (context?: Context | null). Apps that only raise an intent to obtain a result no longer need to pass the fdc3.nothing context explicitly. When context is omitted (or null/undefined is passed) the Desktop Agent proxy substitutes the fdc3.nothing context type, so the wire protocol is unchanged, the IntentHandler is untouched, and intent listeners always receive a concrete context. This is an additive, non-breaking change for TypeScript applications. - fdc3-standard: make context optional/null on the DesktopAgent interface and update the JSDoc and examples - fdc3-agent-proxy: substitute fdc3.nothing when no context is provided - website docs: mirror the interface change - tests: add proxy scenarios for the no-context and null-context cases - CHANGELOG: add entry under [Unreleased] > Changed
0b75945 to
eb7f231
Compare
The context argument of raiseIntent is now optional (context?: Context | null). Apps that only raise an intent to obtain a result no longer need to pass the fdc3.nothing context explicitly.
When context is omitted (or null/undefined is passed) the Desktop Agent proxy substitutes the fdc3.nothing context type, so the wire protocol is unchanged, the IntentHandler is untouched, and intent listeners always receive a concrete context. This is an additive, non-breaking change for TypeScript applications.
Describe your change
Related Issue
resolves #1708
Contributor License Agreement
Review Checklist
DesktopAgent,Channel,PrivateChannel,Listener,Bridging)?JSDoc comments on interfaces and types should be matched to the main documentation in /docs
Conformance test definitions should cover all required aspects of an FDC3 Desktop Agent implementation, which are usually marked with a MUST keyword, and optional features (SHOULD or MAY) where the format of those features is defined
The Web Connection protocol and Desktop Agent Communication Protocol schemas must be able to support all necessary aspects of the Desktop Agent API, while Bridging must support those aspects necessary for Desktop Agents to communicate with each other
npm run build) run and the results checked in?Generated code will be found at
/src/api/BrowserTypes.tsand/or/src/bridging/BridgingTypes.tsBaseContextschema applied viaallOf(as it is in existing types)?titleanddescriptionprovided for all properties defined in the schema?npm run build) run and the results checked in?Generated code will be found at
/src/context/ContextTypes.ts