Skip to content

Conversation

@tanderson-ld
Copy link
Contributor

@tanderson-ld tanderson-ld commented Apr 2, 2025

Requirements

  • I have added test coverage for new or changed functionality

  • I have followed the repository's pull request submission guidelines

  • I have validated my changes against all supported platform versions
    This will be done at a later time on the target branch during integration testing.

Related issues

SDK-858 and SDK-851

Describe the solution you've provided

Refactors payload processing to be reusable between polling data sources and streaming data sources.
Adds OneShotInitializers and PollingSynchronizer.
Adds support to contract tests for sdk-test-harness/feat/fdv2 branch.

@tanderson-ld tanderson-ld changed the base branch from ta/sdk-858/hooking-up-config-rebase to ta/fdv2-temporary-holding April 7, 2025 21:30
@tanderson-ld tanderson-ld marked this pull request as ready for review April 8, 2025 17:13
@tanderson-ld tanderson-ld requested a review from a team as a code owner April 8, 2025 17:13
if (options.wrapper.version) {
cf.wrapperVersion = options.wrapper.version;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: Hooks up configuration for contract tests.

streaming/fdv2/reconnection state management/replaces previously known state
streaming/fdv2/reconnection state management/updates previously known state
streaming/fdv2/ignores model version
streaming/fdv2/can discard partial events on errors
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These suppressions are the fdv2 cases that aren't passing at moment. The state and model ones will be addressed in a future story.

The streaming/fdv2/reconnection state management/initializes from polling initializer one is trickier. The JS configuration does not support the same level of initializer customization that the test harness and Go SDK support, so those cases are not supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: This file change generalizes handling to be agnostic of streaming so that polling and streaming can share the same core logic. It is a rename and then some tweaks.

id: string;
version: number;
state: string;
state?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: This state is now optional as part of a fix to support the "transfer none" case where the server does not give us a state value.

this._attachHandler(eventStream, 'delete-object', this._processDeleteObject);
this._attachHandler(eventStream, 'payload-transferred', this._processPayloadTransferred);
this._attachHandler(eventStream, 'goodbye', this._processGoodbye);
this._attachHandler(eventStream, 'error', this._processError);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: This logic moved to the streaming specific PayloadStreamReader.

`Stream received data that was unable to be processed in "${eventName}" message`,
);
this._logger?.debug(`Data follows: ${event.data}`);
this._errorHandler?.(DataSourceErrorKind.InvalidData, 'Malformed data in event stream');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: This logic moved to the streaming specific PayloadStreamReader.


this._listeners.forEach((it) => it(payload));
this._resetAfterEmission();
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: Transfer none wasn't emitting an empty payload, now that is fixed. The empty payload signals to other layers of the SDK that communication has occurred.

private _resetAll() {
this._tempId = undefined;
this._tempBasis = undefined;
this._tempBasis = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: Various tweaks to support transfer none case and error cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: This logic existed already, but teased apart the streaming specific concerns from the payload processing concerns.

Copy link
Contributor Author

@tanderson-ld tanderson-ld Apr 8, 2025

Choose a reason for hiding this comment

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

For reviewers: Tweaks to hook into the composite data source since the CompositeDataSource is now being used with Streaming and Polling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reviewers: Noticed some seconds to millis conversions were missing here.

@tanderson-ld tanderson-ld requested a review from keelerm84 April 8, 2025 17:27
@tanderson-ld tanderson-ld requested a review from keelerm84 April 10, 2025 20:40
@tanderson-ld tanderson-ld merged commit c1089a5 into ta/fdv2-temporary-holding Apr 11, 2025
3 checks passed
@tanderson-ld tanderson-ld deleted the ta/sdk-851/polling-synchronizer branch April 11, 2025 17:26
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.

4 participants