Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@julianna-ciq
Copy link
Contributor

Describe your change

Adds the metadata property at the end of the .broadcast(), .raiseIntent(), .raiseIntentForContext(), and .open() methods.
Includes schema updates, doc updates, and implementation updates.

Provides placeholder space for signature (see #1571) and hostParams (#1546).

Related Issue

Resolves #1290

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?

@julianna-ciq julianna-ciq requested a review from a team as a code owner May 21, 2025 16:34
@netlify
Copy link

netlify bot commented May 21, 2025

Deploy Preview for fdc3 failed. Why did it fail? →

Name Link
🔨 Latest commit ecd4c72
🔍 Latest deploy log https://app.netlify.com/projects/fdc3/deploys/688a6d99dc0c810008202db5

@kriswest kriswest mentioned this pull request May 22, 2025
16 tasks
})
```

### Timestamp
Copy link
Member

Choose a reason for hiding this comment

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

do we need this? We already have a timestamp in the message meta I think

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, tinestamp could/should be DA provided rather than app provided - even if it's the client code generating it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was in my notes as one of the few properties we should support. Let's discuss what metadata properties should be included at the next Web meeting.

@robmoffat robmoffat added this to the 2.3 candidates milestone Jul 8, 2025
"payload": {
"$ref": "#/$defs/OpenRequestPayload"
},
"metadata": {
Copy link
Member

Choose a reason for hiding this comment

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

@kriswest @julianna-ciq

I've been looking at this. It doesn't seem like this gets generated into OpenRequest object in BrowserTypes. I'm not enough of an expert on JSON schema to really say why, except that I can add the metadata into the base type, AppRequest and it seems to push through.

However, I think this is the wrong place for this: I think the context metadata belongs in the payload, along with the context. After all, the message already has a meta field (which is the meta of the message) so it seems like we need to have meta inside the payload (the meta of the payload).

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that we should create fields in the payload, rather than as a sibling of it. That will move it further from the meta element that relates to the "envelope" or message format and more clearly tie it to a particular API call.

The reason that its not generating out in the current location is that the extra property is not allowed in the AppRequest schema, so when OpenRequest has AppRequest composed with it (as all requests do) the field gets dropped - that is part of the role of AppRequest: to govern the shape of those things derived from it and prevent additionalProperties that should not be there.

I'd say just go ahead and move it into the payload for every API message that should transmit either the app provided or super-set of app and DA-provided metadata (i.e. requests include appProvided, responses include both app and DA provided).

context: Context,
app?: AppIdentifier,
metadata?: AppProvidableContextMetadata
): Promise<IntentResolution>;
Copy link
Member

Choose a reason for hiding this comment

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

This allows metadata to go from the app raising the intent to the app receiving it. However, it doesn't on its own allow metadata to come back from the receiver back to the raiser. We might need to extend the IntentResolution interface to add getResultMetadata perhaps?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point! Changing the return type of IntentResolution.getResult() would not be ideal (breaking).

However, we should also conider the fact that IntentResolution is itself a metadata object and returns the source for the resolution at least:

  • what app did the DA deliver it to...,
  • what was the intent (could have been chosen by the user or DA if there was only one)

But it is returned before the result (should come back at the same time that intent is delivered - so before the result). Hence, before we pick a solution here, what additional metadata might someone want? I'd argue timestamp isn't as interesting in intents (as you can't getCurrentContext() and pick it up later). Signatures are interesting (and would have to come from the app, rather than the DA). Anything else? Signature is probably enough of a use case...

Copy link
Contributor

Choose a reason for hiding this comment

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

Spent some time with @julianna-ciq talking about this - its one of the harder parts to solve in the design because its difficult for IntentHandler functions to return metadata, currently they can return Context, Channel or void, but we'd need a compound type with the metadata to return.

Further, IntentResolution is itself a metadata object that overlaps with the ContextMetadata some already, in that it contains the source field. A trace_id is less useful as it should be the same value used in the original call if provided and its still connected to that call. timestamp is less interesting as we don't have a call like getCurrentCOntext to worry about where it will be received later.

The one case I thought it mattered on is signature, there is a workaround where an app could return a channel and deliver signed results over that instead.

Hence, with added complexity and reduced utility, we think this should just be left out for now, and revisited if anyone comes up with a solid us-case for needing it.

Copy link
Contributor

@kriswest kriswest left a comment

Choose a reason for hiding this comment

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

Review comments for a week or two ago

},
context,
},
metadata,
Copy link
Contributor

Choose a reason for hiding this comment

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

In all other cases, parameters to FDC3 functions go into the payload element... I think we should stick to that pattern

app,
},
meta: meta,
metadata: {
Copy link
Contributor

Choose a reason for hiding this comment

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

See previous comment about keeping this in the payload

traceId?: string;
}

export interface DesktopAgentProvidableContextMetadata {
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that most of these fields are forwarded on from app provided metadata, we should could/should just integrate it into ContextMetadata... I was expecting to see a relationship to that type as that is the one we currently return, containing source

Copy link
Contributor

Choose a reason for hiding this comment

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

ContextMetadata appears defunct after this change, so it either needs to be removed or these changes integrated into it. I prefer the latter (put the new fileds into that type and keep it)

Copy link
Member

Choose a reason for hiding this comment

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

Just in the #1644 meeting, we are discussing the CDM use case. In this case, a CDM message may be broken down into a number of different FDC3 contexts. e.g. a priceQuantity message contains, date, instrument, amount, exchange, each of which might be a different context broadcast.

In this case, to re-assemble the message, it would be nice to use a common traceId across them all, but also have a count metadata item, so you know how many broadcasts should be bundled together.


Optional metadata about each context or intent message received SHOULD be provided by the desktop agent implementation to registered intent handlers. As this metadata is optional, apps making use of it MUST handle cases where it is not provided.

Registered listeners SHOULD receive the following properties:
Copy link
Contributor

Choose a reason for hiding this comment

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

YOu SHOULD be able to pass these - in which case it SHOULD or MUST be passed on. But it needs to be conditional on an app setting it (apart from source which DA MSUT provide and MUST NOT forward if passed by app to avoid spoofing).


Apps SHOULD NOT provide timestamp information. If an app provides a timestamp, the Desktop Agent MUST ignore the timestamp.

### Source
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd use the original label (Originating App Metadata) in the content somewhere to retain the link to the use case.

Intent handlers SHOULD be registered via [`fdc3.addIntentListener`](ref/DesktopAgent#addintentlistener) within 15 seconds of the application launch (the minimum timeout Desktop Agents are required to provide) in order to be widely compatible with Desktop Agent implementations. Individual Desktop Agent implementations MAY support longer timeouts or configuration to control or extend timeouts.

### Originating App Metadata
### Metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a brief textual description saying additional metadata may be passed ...

})
```

### Timestamp
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, tinestamp could/should be DA provided rather than app provided - even if it's the client code generating it

"payload": {
"$ref": "#/$defs/OpenRequestPayload"
},
"metadata": {
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that we should create fields in the payload, rather than as a sibling of it. That will move it further from the meta element that relates to the "envelope" or message format and more clearly tie it to a particular API call.

The reason that its not generating out in the current location is that the extra property is not allowed in the AppRequest schema, so when OpenRequest has AppRequest composed with it (as all requests do) the field gets dropped - that is part of the role of AppRequest: to govern the shape of those things derived from it and prevent additionalProperties that should not be there.

I'd say just go ahead and move it into the payload for every API message that should transmit either the app provided or super-set of app and DA-provided metadata (i.e. requests include appProvided, responses include both app and DA provided).

context: Context,
app?: AppIdentifier,
metadata?: AppProvidableContextMetadata
): Promise<IntentResolution>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Good point! Changing the return type of IntentResolution.getResult() would not be ideal (breaking).

However, we should also conider the fact that IntentResolution is itself a metadata object and returns the source for the resolution at least:

  • what app did the DA deliver it to...,
  • what was the intent (could have been chosen by the user or DA if there was only one)

But it is returned before the result (should come back at the same time that intent is delivered - so before the result). Hence, before we pick a solution here, what additional metadata might someone want? I'd argue timestamp isn't as interesting in intents (as you can't getCurrentContext() and pick it up later). Signatures are interesting (and would have to come from the app, rather than the DA). Anything else? Signature is probably enough of a use case...

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 30, 2025

CLA Missing ID CLA Not Signed

@kriswest
Copy link
Contributor

kriswest commented Aug 7, 2025 via email

@robmoffat
Copy link
Member

Wouldn't you also have the single compound message with them all in? What is suggested in the current docs is that you compose one large context made up of smaller ones, broadcast all the smaller ones with the big one last. Apps can listen for whatever they support.

Yeah makes sense.

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.

Add property to support analytics across apps

3 participants