Skip to content

Commit 449db1b

Browse files
committed
Correcting issues agent-proxy tests after rebase on main post 2.2.2 release
1 parent 0f8db54 commit 449db1b

7 files changed

Lines changed: 83 additions & 52 deletions

File tree

packages/fdc3-agent-proxy/test/features/app-channels.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Feature: Channel Listeners Support
115115
| id.ticker | type | name |
116116
| AAPL | fdc3.instrument | Apple |
117117

118-
Scenario: App channel context listener receives originating app metadata
118+
Scenario: App channel context listener receives source metadata
119119
Given "resultHandler" pipes context and metadata to "contexts" and "metadatas"
120120
When I call "{api1}" with "getOrCreateChannel" with parameter "channel-name"
121121
And I refer to "{result}" as "channel1"
@@ -126,4 +126,4 @@ Feature: Channel Listeners Support
126126
| AAPL | fdc3.instrument | Apple |
127127
And "{metadatas}" is an array of objects with the following contents
128128
| source.appId | source.instanceId |
129-
| broadcasting-app | broadcasting-instance |
129+
| cucumber-app | cucumber-instance |

packages/fdc3-agent-proxy/test/features/broadcast.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Feature: Broadcasting
3030
| {null} | {null} | {null} | getUserChannelsRequest |
3131
| one | fdc3.instrument | Apple | broadcastRequest |
3232

33-
Scenario: Context listener receives originating app metadata
33+
Scenario: Context listener receives source metadata
3434
Given "resultHandler" pipes context and metadata to "contexts" and "metadatas"
3535
When I call "{api}" with "getOrCreateChannel" with parameter "channel-name"
3636
And I refer to "{result}" as "channel1"
@@ -41,4 +41,4 @@ Feature: Broadcasting
4141
| AAPL | fdc3.instrument | Apple |
4242
And "{metadatas}" is an array of objects with the following contents
4343
| source.appId | source.instanceId |
44-
| broadcasting-app | broadcasting-instance |
44+
| cucumber-app | cucumber-instance |

packages/fdc3-agent-proxy/test/features/private-channels.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Feature: Basic Private Channels Support
2626
| id.ticker | type | name |
2727
| AAPL | fdc3.instrument | Apple |
2828

29-
Scenario: Private channel context listener receives originating app metadata
29+
Scenario: Private channel context listener receives source metadata
3030
Given "resultHandler" pipes context and metadata to "contexts" and "metadatas"
3131
When I call "{privateChannel}" with "addContextListener" with parameters "fdc3.instrument" and "{resultHandler}"
3232
And messaging receives "{instrumentMessageOne}"
@@ -35,7 +35,7 @@ Feature: Basic Private Channels Support
3535
| AAPL | fdc3.instrument | Apple |
3636
And "{metadatas}" is an array of objects with the following contents
3737
| source.appId | source.instanceId |
38-
| broadcasting-app | broadcasting-instance |
38+
| cucumber-app | cucumber-instance |
3939

4040
Scenario: Adding and then unsubscribing an "onAddContextListener" listener will send a notification of each event to the agent
4141
Given "typesHandler" pipes events to "types"

packages/fdc3-agent-proxy/test/features/user-channels.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ Feature: Basic User Channels Support
332332
| payload.channelId | payload.contextType | matches_type |
333333
| {null} | fdc3.instrument | addContextListenerRequest |
334334

335-
Scenario: User channel context listener receives originating app metadata
335+
Scenario: User channel context listener receives source metadata
336336
Given "resultHandler" pipes context and metadata to "contexts" and "metadatas"
337337
When I call "{api}" with "joinUserChannel" with parameter "one"
338338
And I call "{api}" with "addContextListener" with parameters "fdc3.instrument" and "{resultHandler}"
@@ -342,4 +342,4 @@ Feature: Basic User Channels Support
342342
| AAPL | fdc3.instrument | Apple |
343343
And "{metadatas}" is an array of objects with the following contents
344344
| source.appId | source.instanceId |
345-
| broadcasting-app | broadcasting-instance |
345+
| cucumber-app | cucumber-instance |

packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class PostMessageLoader implements Loader {
5858
identityValidationHandler?: IdentityValidationHandler;
5959

6060
/** Initial timeout (released once a MessagePort is received - additional steps are outside timeout) */
61-
timeout: NodeJS.Timeout | null = null;
61+
timeout: ReturnType<typeof setTimeout> | null = null;
6262

6363
/** Reference to the get fn's Promise's reject call - used when cancelling. */
6464
rejectFn: ((reason?: string) => void) | null = null;

packages/fdc3-schema/generated/api/BrowserTypes.ts

Lines changed: 67 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,6 @@ export interface OptionalFeatures {
544544
* feature is implemented by the Desktop Agent.
545545
*/
546546
DesktopAgentBridging: boolean;
547-
/**
548-
* Used to indicate whether the exposure of 'originating app metadata' for
549-
* context and intent messages is supported by the Desktop Agent.
550-
*/
551-
OriginatingAppMetadata: boolean;
552547
/**
553548
* Used to indicate whether the optional `fdc3.joinUserChannel`,
554549
* `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by
@@ -689,12 +684,10 @@ export interface AddContextListenerRequestMeta {
689684
* Field that represents the source application that the request being responded to was
690685
* received from, for debugging purposes.
691686
*
692-
* Details of the application instance that broadcast the context.
687+
* Identifier for the app instance that sent the context and/or intent.
693688
*
694689
* The App resolution option chosen.
695690
*
696-
* Details of the application instance that raised the intent.
697-
*
698691
* Identifier for the app instance that was selected (or started) to resolve the intent.
699692
* `source.instanceId` MUST be set, indicating the specific app instance that
700693
* received the intent.
@@ -1192,10 +1185,7 @@ export interface BroadcastEventPayload {
11921185
* The context object that was broadcast.
11931186
*/
11941187
context: Context;
1195-
/**
1196-
* Details of the application instance that broadcast the context.
1197-
*/
1198-
originatingApp?: AppIdentifier;
1188+
metadata: ContextMetadata;
11991189
}
12001190

12011191
/**
@@ -1262,6 +1252,34 @@ export interface Context {
12621252
[property: string]: any;
12631253
}
12641254

1255+
/**
1256+
* Metadata relating to a broadcastEvent or intentEvent, which may include metadata provided
1257+
* by the Desktop Agent or the App that initiated the broadcast, raise intent or open
1258+
* request.
1259+
*/
1260+
export interface ContextMetadata {
1261+
/**
1262+
* Custom metadata that can be used to provide additional information about the context or
1263+
* intent. This allows for individuals to use metadata fields that have yet to be
1264+
* standardized.
1265+
*/
1266+
custom?: { [key: string]: any };
1267+
/**
1268+
* Identifier for the app instance that sent the context and/or intent.
1269+
*/
1270+
source: AppIdentifier;
1271+
/**
1272+
* The timestamp when the context or intent was created, encoded according to [ISO
1273+
* 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator.
1274+
*/
1275+
timestamp: Date;
1276+
/**
1277+
* A unique identifier for the context or intent that can be used to trace the context or
1278+
* intent through the system.
1279+
*/
1280+
traceId: string;
1281+
}
1282+
12651283
/**
12661284
* Identifies the type of the message and it is typically set to the FDC3 function name that
12671285
* the message relates to, e.g. 'findIntent', with 'Response' appended.
@@ -1300,6 +1318,16 @@ export interface BroadcastRequestPayload {
13001318
* The context object that is to be broadcast.
13011319
*/
13021320
context: Context;
1321+
metadata: AppProvidableContextMetadata;
1322+
}
1323+
1324+
/**
1325+
* Metadata that can be provided by an app as part of a broadcast, raise intent or open API
1326+
* call.
1327+
*/
1328+
export interface AppProvidableContextMetadata {
1329+
custom?: { [key: string]: any };
1330+
traceId?: string;
13031331
}
13041332

13051333
/**
@@ -3032,10 +3060,7 @@ export interface IntentEventPayload {
30323060
* The intent that was raised.
30333061
*/
30343062
intent: string;
3035-
/**
3036-
* Details of the application instance that raised the intent.
3037-
*/
3038-
originatingApp?: AppIdentifier;
3063+
metadata: ContextMetadata;
30393064
/**
30403065
* The requestUuid value of the raiseIntentRequest that the intentEvent being sent relates
30413066
* to.
@@ -3366,6 +3391,7 @@ export interface OpenRequestPayload {
33663391
* target app with no context and broadcasting the context directly to it.
33673392
*/
33683393
context?: Context;
3394+
metadata: AppProvidableContextMetadata;
33693395
}
33703396

33713397
/**
@@ -3804,6 +3830,7 @@ export interface RaiseIntentForContextRequest {
38043830
export interface RaiseIntentForContextRequestPayload {
38053831
app?: AppIdentifier;
38063832
context: Context;
3833+
metadata: AppProvidableContextMetadata;
38073834
}
38083835

38093836
/**
@@ -3944,15 +3971,7 @@ export interface RaiseIntentRequestPayload {
39443971
app?: AppIdentifier;
39453972
context: Context;
39463973
intent: string;
3947-
}
3948-
3949-
/**
3950-
* Metadata that can be provided by an app.
3951-
*/
3952-
export interface AppProvidableContextMetadata {
3953-
hostParams?: { [key: string]: any };
3954-
signature?: string;
3955-
traceId?: string;
3974+
metadata: AppProvidableContextMetadata;
39563975
}
39573976

39583977
/**
@@ -5070,7 +5089,6 @@ const typeMap: any = {
50705089
OptionalFeatures: o(
50715090
[
50725091
{ json: 'DesktopAgentBridging', js: 'DesktopAgentBridging', typ: true },
5073-
{ json: 'OriginatingAppMetadata', js: 'OriginatingAppMetadata', typ: true },
50745092
{ json: 'UserChannelMembershipAPIs', js: 'UserChannelMembershipAPIs', typ: true },
50755093
],
50765094
false
@@ -5272,7 +5290,7 @@ const typeMap: any = {
52725290
[
52735291
{ json: 'channelId', js: 'channelId', typ: u(null, '') },
52745292
{ json: 'context', js: 'context', typ: r('Context') },
5275-
{ json: 'originatingApp', js: 'originatingApp', typ: u(undefined, r('AppIdentifier')) },
5293+
{ json: 'metadata', js: 'metadata', typ: r('ContextMetadata') },
52765294
],
52775295
false
52785296
),
@@ -5284,6 +5302,15 @@ const typeMap: any = {
52845302
],
52855303
'any'
52865304
),
5305+
ContextMetadata: o(
5306+
[
5307+
{ json: 'custom', js: 'custom', typ: u(undefined, m('any')) },
5308+
{ json: 'source', js: 'source', typ: r('AppIdentifier') },
5309+
{ json: 'timestamp', js: 'timestamp', typ: Date },
5310+
{ json: 'traceId', js: 'traceId', typ: '' },
5311+
],
5312+
false
5313+
),
52875314
BroadcastRequest: o(
52885315
[
52895316
{ json: 'meta', js: 'meta', typ: r('AddContextListenerRequestMeta') },
@@ -5296,6 +5323,14 @@ const typeMap: any = {
52965323
[
52975324
{ json: 'channelId', js: 'channelId', typ: '' },
52985325
{ json: 'context', js: 'context', typ: r('Context') },
5326+
{ json: 'metadata', js: 'metadata', typ: r('AppProvidableContextMetadata') },
5327+
],
5328+
false
5329+
),
5330+
AppProvidableContextMetadata: o(
5331+
[
5332+
{ json: 'custom', js: 'custom', typ: u(undefined, m('any')) },
5333+
{ json: 'traceId', js: 'traceId', typ: u(undefined, '') },
52995334
],
53005335
false
53015336
),
@@ -5850,7 +5885,7 @@ const typeMap: any = {
58505885
[
58515886
{ json: 'context', js: 'context', typ: r('Context') },
58525887
{ json: 'intent', js: 'intent', typ: '' },
5853-
{ json: 'originatingApp', js: 'originatingApp', typ: u(undefined, r('AppIdentifier')) },
5888+
{ json: 'metadata', js: 'metadata', typ: r('ContextMetadata') },
58545889
{ json: 'raiseIntentRequestUuid', js: 'raiseIntentRequestUuid', typ: '' },
58555890
],
58565891
false
@@ -5951,6 +5986,7 @@ const typeMap: any = {
59515986
[
59525987
{ json: 'app', js: 'app', typ: r('AppIdentifier') },
59535988
{ json: 'context', js: 'context', typ: u(undefined, r('Context')) },
5989+
{ json: 'metadata', js: 'metadata', typ: r('AppProvidableContextMetadata') },
59545990
],
59555991
false
59565992
),
@@ -6091,6 +6127,7 @@ const typeMap: any = {
60916127
[
60926128
{ json: 'app', js: 'app', typ: u(undefined, r('AppIdentifier')) },
60936129
{ json: 'context', js: 'context', typ: r('Context') },
6130+
{ json: 'metadata', js: 'metadata', typ: r('AppProvidableContextMetadata') },
60946131
],
60956132
false
60966133
),
@@ -6130,14 +6167,7 @@ const typeMap: any = {
61306167
{ json: 'app', js: 'app', typ: u(undefined, r('AppIdentifier')) },
61316168
{ json: 'context', js: 'context', typ: r('Context') },
61326169
{ json: 'intent', js: 'intent', typ: '' },
6133-
],
6134-
false
6135-
),
6136-
AppProvidableContextMetadata: o(
6137-
[
6138-
{ json: 'hostParams', js: 'hostParams', typ: u(undefined, m('any')) },
6139-
{ json: 'signature', js: 'signature', typ: u(undefined, '') },
6140-
{ json: 'traceId', js: 'traceId', typ: u(undefined, '') },
6170+
{ json: 'metadata', js: 'metadata', typ: r('AppProvidableContextMetadata') },
61416171
],
61426172
false
61436173
),
@@ -6426,6 +6456,7 @@ const typeMap: any = {
64266456
RaiseIntentResponseType: ['raiseIntentResponse'],
64276457
RaiseIntentResultResponseType: ['raiseIntentResultResponse'],
64286458
};
6459+
64296460
export type AppRequestMessage =
64306461
| AddContextListenerRequest
64316462
| AddEventListenerRequest

website/docs/api/spec.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -877,23 +877,23 @@ For the rationale for separating `Context` and `ContextMetadata`, see the [Conte
877877

878878
Registered listeners MUST receive:
879879

880-
* `timestamp` – Indicates when the message was delivered.
881-
* `source` – Identifies the originating app (`AppIdentifier`).
880+
- `timestamp` – Indicates when the message was delivered.
881+
- `source` – Identifies the originating app (`AppIdentifier`).
882882

883883
Registered listeners MAY receive:
884884

885-
* `traceId` – A unique identifier for tracing the flow of context or intent messages across applications.
886-
* `signature` – A cryptographic signature that can be used to verify the authenticity and integrity of the context or intent message.
887-
* `custom` – Implementation-specific metadata.
885+
- `traceId` – A unique identifier for tracing the flow of context or intent messages across applications.
886+
- `signature` – A cryptographic signature that can be used to verify the authenticity and integrity of the context or intent message.
887+
- `custom` – Implementation-specific metadata.
888888

889889
<!-- TODO insert security/signature field names here -->
890890

891891
### Trace Information
892892

893893
The Desktop Agent MAY provide a `traceId` to intent handlers.
894894

895-
* If the originating app provides a `traceId`, the Desktop Agent MUST forward it.
896-
* If no `traceId` is provided by the app, the Desktop Agent MAY generate a new one.
895+
- If the originating app provides a `traceId`, the Desktop Agent MUST forward it.
896+
- If no `traceId` is provided by the app, the Desktop Agent MAY generate a new one.
897897

898898
Apps MAY propagate `traceId` when performing actions as a result of another FDC3 action. This supports observability and correlation across workflows.
899899

0 commit comments

Comments
 (0)