Skip to content

Implement missing FDC3 Web Connection Protocol steps - #354

Open
Roaders wants to merge 1 commit into
morganstanley:mainfrom
Roaders:fix/wcp-connection-protocol-gaps
Open

Implement missing FDC3 Web Connection Protocol steps#354
Roaders wants to merge 1 commit into
morganstanley:mainfrom
Roaders:fix/wcp-connection-protocol-gaps

Conversation

@Roaders

@Roaders Roaders commented Jun 26, 2026

Copy link
Copy Markdown
Member

Brings the getAgent()/Desktop Agent handshake in line with the FDC3 Web Connection Protocol (WCP1-WCP6):

  • Handle WCP2LoadUrl: load the agent URL into a hidden iframe and restart the handshake against it (isWCPLoadUrl predicate, ProxyUrl agent type).
  • Handle WCP5 failure end-to-end: reject getAgent() with AccessDenied on a WCP5ValidateAppIdentityFailedResponse (was an indefinite hang) and have the root send that response instead of going silent (isWCPFailedResponse).
  • Persist DesktopAgentDetails to SessionStorage and reconnect: read prior details, limit discovery to the previous mechanism, pass instanceId/ instanceUuid in WCP4 and reissue the same instanceId on the root.
  • Channel selector / intent resolver plumbing: WCP1Hello carries the channelSelector/intentResolver flags and the proxy injects UI iframes when the handshake supplies URLs.
  • Validate app identity origins: identityUrl, actualUrl and the WCP1Hello origin must match before identity is issued.
  • Failover: restart the handshake against a returned WindowProxy and reject unsupported results with InvalidFailover.
  • Clean up channel mappings on WCP6Goodbye.

Adds unit and integration coverage for the new behaviours.

Brings the getAgent()/Desktop Agent handshake in line with the FDC3 Web
Connection Protocol (WCP1-WCP6):

- Handle WCP2LoadUrl: load the agent URL into a hidden iframe and restart
  the handshake against it (isWCPLoadUrl predicate, ProxyUrl agent type).
- Handle WCP5 failure end-to-end: reject getAgent() with AccessDenied on a
  WCP5ValidateAppIdentityFailedResponse (was an indefinite hang) and have the
  root send that response instead of going silent (isWCPFailedResponse).
- Persist DesktopAgentDetails to SessionStorage and reconnect: read prior
  details, limit discovery to the previous mechanism, pass instanceId/
  instanceUuid in WCP4 and reissue the same instanceId on the root.
- Channel selector / intent resolver plumbing: WCP1Hello carries the
  channelSelector/intentResolver flags and the proxy injects UI iframes when
  the handshake supplies URLs.
- Validate app identity origins: identityUrl, actualUrl and the WCP1Hello
  origin must match before identity is issued.
- Failover: restart the handshake against a returned WindowProxy and reject
  unsupported results with InvalidFailover.
- Clean up channel mappings on WCP6Goodbye.

Adds unit and integration coverage for the new behaviours.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Roaders
Roaders requested a review from a team as a code owner June 26, 2026 08:57
}
};
iframe.onerror = () => reject(AgentError.ErrorOnConnect);
iframe.src = url;
}
};
iframe.onerror = () => reject(AgentError.ErrorOnConnect);
iframe.src = url;
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.68839% with 107 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.05%. Comparing base (7a1dded) to head (8b7d0e7).

Files with missing lines Patch % Lines
projects/fdc3-web/src/get-agent/get-agent.ts 58.62% 96 Missing ⚠️
projects/fdc3-web/src/app-directory/directory.ts 53.84% 6 Missing ⚠️
projects/fdc3-web/src/helpers/url-helper.ts 75.00% 3 Missing ⚠️
...cts/fdc3-web/src/helpers/session-storage.helper.ts 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
- Coverage   91.59%   91.05%   -0.55%     
==========================================
  Files          42       43       +1     
  Lines        5234     5521     +287     
  Branches      915      962      +47     
==========================================
+ Hits         4794     5027     +233     
- Misses        426      481      +55     
+ Partials       14       13       -1     
Flag Coverage Δ
unittests 91.05% <69.68%> (-0.55%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
projects/fdc3-web/src/contracts.ts 100.00% <ø> (ø)
...dc3-web/src/helpers/finos-type-predicate.helper.ts 99.42% <100.00%> (+0.01%) ⬆️
projects/fdc3-web/src/helpers/messages.helper.ts 100.00% <100.00%> (ø)
...saging-provider/default-root-messaging-provider.ts 91.48% <100.00%> (+0.37%) ⬆️
...s/fdc3-web/src/messaging/root-message-publisher.ts 86.63% <100.00%> (+4.58%) ⬆️
...cts/fdc3-web/src/helpers/session-storage.helper.ts 91.30% <91.30%> (ø)
projects/fdc3-web/src/helpers/url-helper.ts 94.73% <75.00%> (-5.27%) ⬇️
projects/fdc3-web/src/app-directory/directory.ts 91.04% <53.84%> (-0.86%) ⬇️
projects/fdc3-web/src/get-agent/get-agent.ts 70.48% <58.62%> (+4.40%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants