-
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
Changes from 2 commits
56459c0
8113122
22483ef
935b994
38af523
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(); | ||||
|
||||
| payloadListener = createPayloadListener(dataSourceUpdates, logger, initSuccess); |
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.
I agree there is a bug in the code before this PR as even when payload.basis is false, basisReceived is called.
LDClientImpl is passing in a function called initSuccess. I think at that time I had thought getting a basis (independent of selector) was sufficient to consider it initialized. This would be my thinking at the time since I thought this code path was only hit when basis == true.
Since Casey's requirement is "Basis with a Payload Selector.", should this logic be updated to ensure basis is also true when selector is not null?
The name basisRecieved in basisReceived: VoidFunction = () => {} parameter may need to be adjusted.
Uh oh!
There was an error while loading. Please reload this page.