Skip to content

fdc3.addContextListener() accepts array type#1810

Open
kemerava wants to merge 3 commits intofinos:mainfrom
kemerava:feature/1646-addContextListener-array
Open

fdc3.addContextListener() accepts array type#1810
kemerava wants to merge 3 commits intofinos:mainfrom
kemerava:feature/1646-addContextListener-array

Conversation

@kemerava
Copy link
Copy Markdown
Contributor

@kemerava kemerava commented Mar 27, 2026

Describe your change

Handing the addContextListener with array type: if an array is passed, then the handler will be call for all the types in the array.

Seeking opinion: I have added logic such that if there is a null passed to the array, then it is behaving the same way as passing null into addContextListner(null) -> listen to all. But if an empty array is passed in, then nothing is listened on. Also the implementation of the agent proxy made me think about some potential questions, like would it be possible to unsubscribe somehow just from one of the context types?

Related Issue

resolves #1646

Contributor License Agreement

  • I acknowledge that a contributor license agreement is required and that I have one in place or will seek to put one in place ASAP.

Review Checklist

  • Issue: If a change was made to the FDC3 Standard, was an issue linked above?
  • CHANGELOG: Is a CHANGELOG.md entry included?
  • API changes: Does this PR include changes to any of the FDC3 APIs (DesktopAgent, Channel, PrivateChannel, Listener, Bridging)?
    • Docs & Sources: If yes, were both documentation (/docs) and sources updated?

      JSDoc comments on interfaces and types should be matched to the main documentation in /docs
    • Conformance tests: If yes, are conformance test definitions (/toolbox/fdc3-conformance) still correct and complete?

      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
    • Schemas: If yes, were changes applied to the Bridging and FDC3 for Web protocol schemas?

      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
      • If yes, was code generation (npm run build) run and the results checked in?

        Generated code will be found at /src/api/BrowserTypes.ts and/or /src/bridging/BridgingTypes.ts
  • Context types: Were new Context type schemas created or modified in this PR?
    • Were the field type conventions adhered to?
    • Was the BaseContext schema applied via allOf (as it is in existing types)?
    • Was a title and description provided for all properties defined in the schema?
    • Was at least one example provided?
    • Was code generation (npm run build) run and the results checked in?

      Generated code will be found at /src/context/ContextTypes.ts
  • Intents: Were new Intents created in this PR?

@kemerava kemerava requested a review from a team as a code owner March 27, 2026 14:23
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for fdc3 ready!

Name Link
🔨 Latest commit 7ca9ccf
🔍 Latest deploy log https://app.netlify.com/projects/fdc3/deploys/69ca88745f10b30008a0ff4c
😎 Deploy Preview https://deploy-preview-1810.preview-fdc3.finos.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: fdc3.addContextListener() should accept an array of contextTypes to listen for

1 participant