Skip to content

Make ContextMetadata traceId optional - #2157

Open
julianna-ciq wants to merge 33 commits into
finos:mainfrom
julianna-ciq:fix/optional-context-metadata-trace-id
Open

Make ContextMetadata traceId optional#2157
julianna-ciq wants to merge 33 commits into
finos:mainfrom
julianna-ciq:fix/optional-context-metadata-trace-id

Conversation

@julianna-ciq

Copy link
Copy Markdown
Contributor

Describe your change

Makes ContextMetadata.traceId optional across the API schema, generated BrowserTypes and BridgingTypes, public typings, documentation, and conformance checks. Desktop Agents may generate a trace ID, so callers can construct an IntentEventPayload without supplying one.

Related Issue

N/A — reported as a mismatch between the public ContextMetadata type and the generated browser protocol payload.

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.

Validation

  • npm run build in packages/fdc3-schema
  • npm run build in packages/fdc3-standard
  • npm run build in toolbox/fdc3-conformance
  • Verified public ContextMetadata without traceId is assignable to BrowserTypes.IntentEventPayload.metadata
  • Verified generated IntentEvent runtime conversion accepts metadata without traceId

@julianna-ciq
julianna-ciq requested a review from a team as a code owner August 28, 2026 13:19
@netlify

netlify Bot commented Aug 28, 2026

Copy link
Copy Markdown

Deploy Preview for fdc3 ready!

Name Link
🔨 Latest commit f326bb0
🔍 Latest deploy log https://app.netlify.com/projects/fdc3/deploys/6a91900b84f2da0008bf2b86
😎 Deploy Preview https://deploy-preview-2157.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.

@codecov-commenter

codecov-commenter commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (cb00631) to head (f326bb0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2157   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files          73       73           
  Lines        4251     4251           
  Branches      596      604    +8     
=======================================
  Hits         4040     4040           
  Misses        211      211           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@kriswest kriswest left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I expected traceId to be required in ContextMetadata as it was to be generated by the DA if not provided - and thought that was what was agreed in the working group. It is already optional in AppProvidableContextMetadata (https://fdc3.finos.org/docs/next/api/ref/Types#appprovidablecontextmetadata).

The docs are not currently in agreement with sources as they do say the DA may provide a traceId - but I think that is the error, not the sources requiring it on output. The conformance tests agree with the sources, whicch you change in this PR. Generation of a UIUD is if it was not provided seems a lesser burden on DAs than apps checking for its existence on using it. So I think we should be making the alternative change and updating the API overview content to require DAs to generate it if not present.

I note that the Agent Proxy is generating traceIds for raiseIntent if one is not provided at:

traceId: metadata?.traceId ?? v4(),

The reference implementation generates one for a raiseIntent request if not provided:

traceId: appProvidedMeta.traceId ?? sc.createUUID(),

and for a result if not provided:
traceId: appMeta.traceId ?? sc.createUUID(),

I don't see the same on broadcast in the proxy:

The reference implementation handles generation for a broadcast:

traceId: appProvidedMetadata.traceId ?? sc.createUUID(),

While I think we should go the other way here and require DAs to generate the traceId if not present - were we to go this way, more work is required IMHO,

@kriswest

kriswest commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Can we get an issue open for this.

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.

3 participants