Skip to content
Draft
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
26c7150
Moved state into ServerContext from BroadcastHandler
robmoffat Oct 31, 2025
fafd10f
Moved state out of IntentHandler
robmoffat Nov 4, 2025
e97e98c
OpenHandler now stateless, created AbstractServerContext
robmoffat Nov 4, 2025
5dcfce6
work in progress refactoring
robmoffat Nov 4, 2025
701a375
fdc3-web-impl looking sensible
robmoffat Nov 4, 2025
0c35c00
fdc3-web-impl tests running, 2 failing
robmoffat Nov 4, 2025
8de4042
fixed issue where it wasn't unsubscribing before disconnecting
robmoffat Nov 4, 2025
a49fbf4
Tests passing and completing ok
robmoffat Nov 4, 2025
6b11d1e
get-agent tests working
robmoffat Nov 4, 2025
bb760dc
Conformance tests passing
robmoffat Nov 5, 2025
162a839
Code coverage. Moving event propagation into FDC3ServerInstance
robmoffat Nov 5, 2025
994fdb2
Added changelog
robmoffat Nov 5, 2025
8fe4d5f
renamed 2 files for clarity. fixed linter issue
robmoffat Nov 5, 2025
719a5c5
removed unused import
robmoffat Nov 5, 2025
e237716
fixing rename issues
robmoffat Nov 5, 2025
6e203cf
modifying timers to address a race condition on closing windows
robmoffat Nov 6, 2025
87902ea
Removed fdc3-web-impl, got get-agent tests working
robmoffat Jan 13, 2026
4cf58e4
Allowed coverage of test/support classes
robmoffat Jan 13, 2026
4ec1956
Removed unused test code
robmoffat Jan 13, 2026
e0a1931
Removed unused responses
robmoffat Jan 13, 2026
6d67ed0
removed unused code
robmoffat Jan 13, 2026
7e82114
Merge branch 'fdc3-new-conformance-2.2' into server-context-refactor
robmoffat Jan 15, 2026
49ad71f
Merge branch 'main' into server-context-refactor
robmoffat Jan 15, 2026
ac4a2ae
Publish fdc3-testing for use in Sail / other downstreams
robmoffat Jan 15, 2026
db502d2
Added readme for the testing folder
robmoffat Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Added Conformance tests for FDC3 2.2 ([#1586](https://github.com/finos/FDC3/pull/1586))
* Fix for channel change listeners not sending addEventListenerRequests ([#1606](https://github.com/finos/FDC3/pull/1606))
* When adding a listener on the current channel, the payload.channelId should be null ([#1611](https://github.com/finos/FDC3/pull/1611))
* Refactoring of the `fdc3-web-impl` handlers to remove cyclic dependency and manage state in `FDC3ServerInstance`s. ([#1696](https://github.com/finos/FDC3/pull/1696))

### Deprecated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { MockStorage } from '../support/MockStorage';
import { DesktopAgent, ImplementationMetadata } from '@finos/fdc3-standard';
import { clearAgentPromise } from '../../src/strategies/getAgent';
import expect from 'expect';
import { dummyInstanceDetails } from '../support/TestServerContext';
import { dummyInstanceDetails } from '../support/MockFDC3Server';
import { MockIFrame } from '../support/MockIFrame';

interface MockPageTransitionEvent extends Event {
Expand All @@ -35,43 +35,43 @@ Given(
'Parent Window desktop {string} listens for postMessage events in {string}, returns direct message response',
async function (this: CustomWorld, field: string, w: string) {
const mockWindow = handleResolve(w, this);
this.mockFDC3Server = new MockFDC3Server(mockWindow, false, this.mockContext);
this.mockFDC3Server = new MockFDC3Server(mockWindow, false, this);
this.props[field] = this.mockFDC3Server;
this.mockContext.open(dummyInstanceDetails[0].appId);
this.mockContext.open(dummyInstanceDetails[1].appId);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
this.mockFDC3Server.open(dummyInstanceDetails[1].appId);
}
);

Given(
'Parent Window desktop {string} listens for postMessage events in {string}, returns direct message response, but times out identity validation',
async function (this: CustomWorld, field: string, w: string) {
const mockWindow = handleResolve(w, this);
this.mockFDC3Server = new MockFDC3Server(mockWindow, false, this.mockContext, true, true);
this.mockFDC3Server = new MockFDC3Server(mockWindow, false, this, [], [], undefined, true, true);
this.props[field] = this.mockFDC3Server;
this.mockContext.open(dummyInstanceDetails[0].appId);
this.mockContext.open(dummyInstanceDetails[1].appId);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
this.mockFDC3Server.open(dummyInstanceDetails[1].appId);
}
);

Given(
'Parent Window desktop {string} listens for postMessage events in {string}, returns direct message response and uses default UI URLs',
async function (this: CustomWorld, field: string, w: string) {
const mockWindow = handleResolve(w, this);
this.mockFDC3Server = new MockFDC3Server(mockWindow, false, this.mockContext, true);
this.mockFDC3Server = new MockFDC3Server(mockWindow, false, this, [], [], undefined, true);
this.props[field] = this.mockFDC3Server;
this.mockContext.open(dummyInstanceDetails[0].appId);
this.mockContext.open(dummyInstanceDetails[1].appId);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
this.mockFDC3Server.open(dummyInstanceDetails[1].appId);
}
);

Given(
'Parent Window desktop {string} listens for postMessage events in {string}, returns direct message response and times out message exchanges',
async function (this: CustomWorld, field: string, w: string) {
const mockWindow = handleResolve(w, this);
this.mockFDC3Server = new MockFDC3Server(mockWindow, false, this.mockContext, true, false, true);
this.mockFDC3Server = new MockFDC3Server(mockWindow, false, this, [], [], undefined, true, false, true);
this.props[field] = this.mockFDC3Server;
this.mockContext.open(dummyInstanceDetails[0].appId);
this.mockContext.open(dummyInstanceDetails[1].appId);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
this.mockFDC3Server.open(dummyInstanceDetails[1].appId);
}
);

Expand All @@ -84,39 +84,42 @@ Given(
this.mockFDC3Server = new MockFDC3Server(
mockWindow,
false,
this.mockContext,
this,
[],
[],
undefined,
true,
false,
true,
messageExchangeTimeout,
appLaunchTimeout
);
this.props[field] = this.mockFDC3Server;
this.mockContext.open(dummyInstanceDetails[0].appId);
this.mockContext.open(dummyInstanceDetails[1].appId);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
this.mockFDC3Server.open(dummyInstanceDetails[1].appId);
}
);

Given(
'Parent Window desktop {string} listens for postMessage events in {string}, returns iframe response',
async function (this: CustomWorld, field: string, w: string) {
const mockWindow = handleResolve(w, this);
this.mockFDC3Server = new MockFDC3Server(mockWindow, true, this.mockContext);
this.mockFDC3Server = new MockFDC3Server(mockWindow, true, this);
this.props[field] = this.mockFDC3Server;
this.mockContext.open(dummyInstanceDetails[0].appId);
this.mockContext.open(dummyInstanceDetails[1].appId);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
this.mockFDC3Server.open(dummyInstanceDetails[1].appId);
}
);

Given(
'{string} is a function which opens an iframe for communications on {string}',
function (this: CustomWorld, fn: string, doc: string) {
this.props[fn] = () => {
this.mockContext.open(dummyInstanceDetails[0].appId);
const document = handleResolve(doc, this) as MockDocument;
const ifrm = document.createElement('iframe');

this.mockFDC3Server = new MockFDC3Server(ifrm as unknown as MockIFrame, false, this.mockContext);
this.mockFDC3Server = new MockFDC3Server(ifrm as unknown as MockIFrame, false, this);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
ifrm.setAttribute('src', EMBED_URL);
document.body.appendChild(ifrm);
return ifrm;
Expand All @@ -128,11 +131,20 @@ Given(
'{string} is a function which opens an iframe for communications on {string} but times out identity validation',
function (this: CustomWorld, fn: string, doc: string) {
this.props[fn] = () => {
this.mockContext.open(dummyInstanceDetails[0].appId);
const document = handleResolve(doc, this) as MockDocument;
const ifrm = document.createElement('iframe');

this.mockFDC3Server = new MockFDC3Server(ifrm as unknown as MockIFrame, false, this.mockContext, true, true);
this.mockFDC3Server = new MockFDC3Server(
ifrm as unknown as MockIFrame,
false,
this,
[],
[],
undefined,
true,
true
);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
ifrm.setAttribute('src', EMBED_URL);
document.body.appendChild(ifrm);
return ifrm;
Expand All @@ -144,18 +156,21 @@ Given(
'{string} is a function which opens an iframe for communications on {string} and times out message exchanges',
function (this: CustomWorld, fn: string, doc: string) {
this.props[fn] = () => {
this.mockContext.open(dummyInstanceDetails[0].appId);
const document = handleResolve(doc, this) as MockDocument;
const ifrm = document.createElement('iframe');

this.mockFDC3Server = new MockFDC3Server(
ifrm as unknown as MockIFrame,
false,
this.mockContext,
this,
[],
[],
undefined,
false,
false,
true
);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
ifrm.setAttribute('src', EMBED_URL);
document.body.appendChild(ifrm);
return ifrm;
Expand All @@ -169,20 +184,23 @@ Given(
const messageExchangeTimeout: number = handleResolve(t1, this);
const appLaunchTimeout: number = handleResolve(t2, this);
this.props[fn] = () => {
this.mockContext.open(dummyInstanceDetails[0].appId);
const document = handleResolve(doc, this) as MockDocument;
const ifrm = document.createElement('iframe');

this.mockFDC3Server = new MockFDC3Server(
ifrm as unknown as MockIFrame,
false,
this.mockContext,
this,
[],
[],
undefined,
false,
false,
true,
messageExchangeTimeout,
appLaunchTimeout
);
this.mockFDC3Server.open(dummyInstanceDetails[0].appId);
ifrm.setAttribute('src', EMBED_URL);
document.body.appendChild(ifrm);
return ifrm;
Expand All @@ -191,7 +209,7 @@ Given(
);

Given('an existing app instance in {string}', async function (this: CustomWorld, field: string) {
const uuid = this.mockContext.open(dummyInstanceDetails[0].appId);
const uuid = await this.mockFDC3Server!.open(dummyInstanceDetails[0].appId);
this.props[field] = uuid;
});

Expand Down
2 changes: 1 addition & 1 deletion packages/fdc3-get-agent/test/support/FrameTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function handleEmbeddedIframeComms(_value: string, parent: MockWindow, so
eventSource == parent ? '(parent window): ' : '(NOT parent win): ',
event.data
);
const connection = cw.mockContext.getFirstInstance();
const connection = cw.mockFDC3Server?.getFirstInstance();

// send the other end of the channel to the app
const message: WebConnectionProtocol3Handshake = {
Expand Down
Loading
Loading