Skip to content

fix: better support 1.2 DAs by not requiring appMetadata in getInfo responses#1550

Merged
kriswest merged 11 commits intomainfrom
1549-workbench-stopped-working-in-1.2
Apr 4, 2025
Merged

fix: better support 1.2 DAs by not requiring appMetadata in getInfo responses#1550
kriswest merged 11 commits intomainfrom
1549-workbench-stopped-working-in-1.2

Conversation

@kriswest
Copy link
Copy Markdown
Contributor

@kriswest kriswest commented Mar 26, 2025

Describe your change

The recent update to the FDC3 Workbench for FDC3 for the web has caused it to stop working with DAs still running FDC3 1.2. This is due to the assumption that the appMetadata element of ImplementationMetadata will be returned by a call to getInfo().

ImplementationMetadata in 1.2: https://fdc3.finos.org/docs/1.2/api/ref/Metadata#implementationmetadata
ImplementationMetadata in 2.0: https://fdc3.finos.org/docs/2.0/api/ref/Metadata#implementationmetadata

getAgent code that assumes it exists (in DesktopAgentPreloadLoader):

appId: implMetadata.appMetadata.appId,
instanceId: implMetadata.appMetadata.instanceId ?? 'unknown',
instanceUuid: implMetadata.appMetadata.instanceId ?? 'unknown', // preload DAs don't issue these so repeat the instanceId

A fix for this should be possible as in 1.2 we only have preload DAs and they don't support any of the features that rely on the stored data (such as recovering the same instanceId - generally managing that themselves by tracking the window)

Related Issue

resolves #1549

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?

@kriswest kriswest requested a review from a team as a code owner March 26, 2025 12:54
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 26, 2025

Deploy Preview for fdc3 ready!

Name Link
🔨 Latest commit ed2470d
🔍 Latest deploy log https://app.netlify.com/sites/fdc3/deploys/67f00dba2895d900085cbd65
😎 Deploy Preview https://deploy-preview-1550--fdc3.netlify.app
📱 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 site configuration.

@github-actions
Copy link
Copy Markdown

504 passed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 26, 2025

Coverage Report

Commit: ed2470d
Base: main@80ea886

Type Base This PR
Total Statements Coverage  97.38%  97.41% (+0.03%)
Total Branches Coverage  86.71%  86.6% (-0.11%)
Total Functions Coverage  96.66%  96.66% (+0%)
Total Lines Coverage  97.45%  97.48% (+0.03%)
Details (changed files)
FileStatementsBranchesFunctionsLines
packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts 100% 77.77% 100% 100%
packages/fdc3-get-agent/src/strategies/getAgent.ts 100% 100% 100% 100%
Details (all files)
FileStatementsBranchesFunctionsLines
packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/index.ts 100% 100% 62.5% 100%
packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts 88% 50% 100% 88%
packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts 98.71% 100% 94.44% 100%
packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts 97.29% 66.66% 100% 97.29%
packages/fdc3-agent-proxy/src/heartbeat/DefaultHeartbeatSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts 100% 60% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts 100% 90% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts 100% 77.77% 100% 100%
packages/fdc3-agent-proxy/src/listeners/EventListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/HeartbeatListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts 93.33% 72.72% 100% 93.33%
packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts 94.59% 100% 80% 94.59%
packages/fdc3-agent-proxy/src/util/AbstractFDC3Logger.ts 100% 94.11% 100% 100%
packages/fdc3-agent-proxy/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/util/throwIfUndefined.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/index.ts 100% 100% 28.57% 100%
packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/messaging/message-port.ts 97.43% 86.66% 100% 97.43%
packages/fdc3-get-agent/src/sessionStorage/DesktopAgentDetails.ts 97.36% 89.47% 100% 97.36%
packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts 100% 77.77% 100% 100%
packages/fdc3-get-agent/src/strategies/FailoverHandler.ts 100% 76.47% 100% 100%
packages/fdc3-get-agent/src/strategies/HelloHandler.ts 94% 81.25% 100% 94%
packages/fdc3-get-agent/src/strategies/IdentityValidationHandler.ts 95.65% 73.33% 100% 95.65%
packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts 98.48% 86.95% 100% 98.46%
packages/fdc3-get-agent/src/strategies/Timeouts.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/strategies/getAgent.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts 97.14% 71.42% 100% 97.01%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts 100% 75% 100% 100%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts 100% 90% 100% 100%
packages/fdc3-get-agent/src/ui/NullChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/NullIntentResolver.ts 100% 100% 66.66% 100%
packages/fdc3-get-agent/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/util/Uuid.ts 100% 100% 100% 100%
packages/fdc3-standard/src/index.ts 100% 100% 0% 100%
packages/fdc3-standard/src/api/Errors.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/GetAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Methods.ts 94.04% 84.05% 96.29% 95%
packages/fdc3-standard/src/api/RecommendedChannels.ts 100% 100% 100% 100%
packages/fdc3-standard/src/context/ContextType.ts 100% 100% 100% 100%
packages/fdc3-standard/src/intents/Intents.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/contextConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/intentConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/typeHelpers.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts 96.87% 84.21% 100% 96.55%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts 96.38% 86.41% 100% 96.12%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts 88.23% 71.87% 86.66% 90%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts 95.6% 86.56% 100% 95%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts 97.14% 86.84% 100% 97.14%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts 100% 100% 100% 100%

@kriswest
Copy link
Copy Markdown
Contributor Author

@himanksegar PR with a fix raised.

@github-actions
Copy link
Copy Markdown

504 passed

@kriswest
Copy link
Copy Markdown
Contributor Author

@john-ciq You should be able to test this fix from url: https://deploy-preview-1550--fdc3.netlify.app/toolbox/fdc3-workbench (or thereabouts) - I can't due to a corporate firewall, which also covers @himanksegar. Could you give it a go in a 1.2 DA and see if it resolves the issue?

@john-ciq
Copy link
Copy Markdown

@john-ciq You should be able to test this fix from url: https://deploy-preview-1550--fdc3.netlify.app/toolbox/fdc3-workbench (or thereabouts) - I can't due to a corporate firewall, which also covers @himanksegar. Could you give it a go in a 1.2 DA and see if it resolves the issue?

The link you provided works. Two notes:

  1. The page attempts to load https://fdc3.finos.org/schemas/next/context.schema.json but this is a 404
  2. FDC3 1.2 implementations will cause a "Failed to load user channels" warning toast (I think this is expected)

mistryvinay
mistryvinay previously approved these changes Mar 27, 2025
Copy link
Copy Markdown
Contributor

@mistryvinay mistryvinay left a comment

Choose a reason for hiding this comment

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

Approved. LGTM.

hughtroeger
hughtroeger previously approved these changes Mar 27, 2025
@kriswest
Copy link
Copy Markdown
Contributor Author

@john-ciq Thank you for testing

  1. The page attempts to load https://fdc3.finos.org/schemas/next/context.schema.json but this is a 404

I know why that is and will fix that.

  1. FDC3 1.2 implementations will cause a "Failed to load user channels" warning toast (I think this is expected)

I don't think its expected. The behaviour it should be using depends on the version of the workbench thats selected. It comes in 1.2 and 2.0+ flavours and should be automatically selecting the right one... you can force it to one or the other in UI:

image

If running on a 1.2 agent it needs to use the getSystemChannels() API call and getUserChannels() from 2.0 onwards and (I think) should switch between them when you select a version... Any chance you could confirm which version is selected when you test and whether the auto-select is working?

@kriswest kriswest dismissed stale reviews from hughtroeger and mistryvinay via 2d0ef1a March 27, 2025 16:17
@github-actions
Copy link
Copy Markdown

504 passed

@kriswest
Copy link
Copy Markdown
Contributor Author

@john-ciq I figured out why the channels issue was occurring - the version switch isn't switching that behaviour anymore. I found a better way to make it backwards compatible and it should work now - if you can retest, please do.

@github-actions
Copy link
Copy Markdown

504 passed

@john-ciq
Copy link
Copy Markdown

@kriswest I still see the error getting channels and also the context schema fails during parse.

Please double check the URL I tested with to make sure I have it correct:
https://deploy-preview-1550--fdc3.netlify.app/toolbox/fdc3-workbench/?fdc3Version=1.2/

The console during the load:
image

20250327.1647Z.mov

@kriswest
Copy link
Copy Markdown
Contributor Author

@john-ciq looks like the URL it's trying to load has updated, so you must be on the new build.

Can you load this directly https://fdc3.finos.org/schemas/next/context/context.schema.json ?

@john-ciq
Copy link
Copy Markdown

@john-ciq looks like the URL it's trying to load has updated, so you must be on the new build.

Can you load this directly https://fdc3.finos.org/schemas/next/context/context.schema.json ?

Yes, that URL loads. I suspect that the code which parses the schema is at fault. I haven't decompiled it, but the error indicates that Buffer is not defined. I think this needs to be polyfilled since Buffer is a node object.

@kriswest
Copy link
Copy Markdown
Contributor Author

I can replicate the user channels issue in the FDC3 for Web demo AND the failure to download the context schema (which does exist at the correct URL). These appear to be new issues that need resolving before release.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2025

506 passed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2025

506 passed

1 similar comment
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2025

506 passed

@kriswest kriswest requested a review from robmoffat April 4, 2025 16:48
robmoffat
robmoffat previously approved these changes Apr 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2025

506 passed

@kriswest
Copy link
Copy Markdown
Contributor Author

kriswest commented Apr 4, 2025

Asked @robmoffat to re-approve this PR after we got it retested and some small fixes in the workbench pushed.

@kriswest kriswest merged commit 9ad21fe into main Apr 4, 2025
7 of 8 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2025

506 passed

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.

FDC3 Workbench has stopped working with FDC3 1.2

5 participants