-
Notifications
You must be signed in to change notification settings - Fork 19
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
chore: preparation work for FDv2 feature store and persistence support #725
base: ta/fdv2-temporary-holding
Are you sure you want to change the base?
Conversation
@launchdarkly/js-sdk-common size report |
@launchdarkly/js-client-sdk-common size report |
@launchdarkly/js-client-sdk size report |
this._featureStore.get(kind, key, doUpsert); | ||
} else { | ||
doUpsert(); | ||
} |
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.
For reviewers: upsert and init have been combined and the distinction is now driven by the bool basis
.
[VersionedDataKinds.Features.namespace]: oldFlags, | ||
[VersionedDataKinds.Segments.namespace]: oldSegments, | ||
}; | ||
doInit(oldData); | ||
}); | ||
}); |
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.
For reviewers: These all
calls feel a bit off, but without a refactoring of layer responsibility, I don't see a change that is worth the effort. Thoughts?
} else { | ||
items[key] = item; | ||
} | ||
} |
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.
For reviewers: This logic has moved into apply changes.
} | ||
}); | ||
}); | ||
} |
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.
For reviewers: Guts of this logic comes from _addItem at the top of this file. Small tweaks from there.
}); | ||
_callback(); | ||
} | ||
} |
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.
For reviewers: This code is not shippable (why this PR is going to a temp branch) due to the intermediate states potentially being invalid, but this temporary code allows contract tests not checking intermediate state to pass.
Splitting these changes up into multiple PRs to keep them manageable and because we can't merge directly to main as
applyChanges
is dependent on transaction support in the PersistentDataStore.Existing tests are exercising applyChanges, but through init, upsert, and delete. Plan to add applyChanges tests in ta/fdv2-temporary-holding after transaction support is added to PersistentDataStore in a subsequent PR as part of SDK-1029