Repository navigation
Conversation
… stores its own Stored remote settings are keyed by application version, so that two releases live at the same time can be answered differently. The cost was that every deploy started with no entry of its own: each visitor's first session on the new release was drawn on the init settings and reported no remote configuration version, until the fetch it triggered was stored for the next session. When this release has no entry yet, readRemoteConfig now reads the entry the same site, application and environment most recently stored under another release. Those are the settings this release gets too unless the console targets releases apart, and even then they are the latest decision on record, which the init settings are not. The release's own answer replaces them as soon as it is stored. The version floor in store() still only looks at this release's own entry, so a borrowed version neither refuses this release's answer nor makes it look like a repeat, and REMOTE_CONFIGURATION_STORED still fires on the first own write.
Collaborator
Author
|
Superseded by 48: the application version is dropped from the cache key instead of reading another release's entry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Stored remote settings are keyed by
site | applicationId | env | version. The application version is part of the key so two releases live at the same time can be answered differently. Because of that, every deploy starts with no cache entry for the new release. Each visitor's first session on it is then drawn on the init settings and carries no_dd.configuration.rc_version. The fetch that session triggers only takes effect for the session after it.For a site that deploys often, this is a constant stream of sessions that never apply the published settings, and that look unreached when counting adoption.
Change
readRemoteConfig: when this release has no entry of its own, read the entry most recently written (by its write timet) for the same site, application and environment under another release.|cannot occur inside an encoded part. So the prefix up to the last separator matches the identity exactly.buildStoreKey(no separator) never match anything.store()keeps comparing against this release's own entry only, so a borrowed version:REMOTE_CONFIGURATION_STOREDstill fires on the first own write andendSessionIfSettingsAreDecisivecompares against the release's own settings.applied_versionsent on the config request is the borrowed version, which is what the running session is actually on.Trade-off: if the console targets releases with different settings, the first session of a new release uses the previous release's settings instead of the init ones until its own answer is stored. That is still the latest decision on record. Before this change, that session got the init values in every case.
Verification
remoteConfiguration.spec.tsplus 1 inrumSessionManager.spec.ts. Fullyarn test:unitpasses (3194). Negative control: with the fallback line removed, exactly the 3 tests that exercise it fail. The other 3 guard against over-reach and pass either way.1.0.0loads and stores config v7, then the session is cleared and release2.0.0loads.2.0.0sessionrc_versionapplied_versionon its config request770.3.0🤖 Generated with Claude Code