-
Notifications
You must be signed in to change notification settings - Fork 31
fix: FDv2 initializer readiness #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
56459c0
8113122
22483ef
935b994
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -68,7 +68,14 @@ export const createPayloadListener = | |||
| dataSourceUpdates.applyChanges( | ||||
| payload.basis, | ||||
| converted, | ||||
| basisReceived, | ||||
| () => { | ||||
| if (payload.state !== '') { | ||||
joker23 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| // NOTE: this is a hack right now. The only condition that we will consider a valid basis | ||||
joker23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||
| // is when there is a valid selector. Currently, the only data source that does not have a | ||||
| // valid selector is the file data initializer, which will have a blank selector. | ||||
| basisReceived(); | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would the FDv2 fallback also not have a selector? I may just not know how that part works.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From my understanding here, the basis can be consumed without a selector, however that would not be considered a successful initialization from this particular initializer. I think this function might not be named correctly here as from the invocation it is simply a success callback (
|
||||
| } | ||||
joker23 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| }, | ||||
| initMetadata, | ||||
| payload.state, | ||||
| ); | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: New conditional logic in callback lacks test coverage
The tests were changed from verifying that
basisReceivedis passed directly toapplyChangesto usingexpect.any(Function), but there's no test that verifies the new conditional behavior. The key new logic (if (payload.state !== '')determines whetherbasisReceived()is called) is not covered by any test. The tests don't verify thatbasisReceivedis actually invoked whenstateis non-empty, nor that it's skipped whenstateis empty (for file data initializer scenarios). This means the core fix described in the PR could regress without test detection.Additional Locations (1)
packages/shared/sdk-server/__tests__/data_sources/createPayloadListenersFDv2.test.ts#L170-L171