✨ implement remote configuration async loading & caching#4606
Merged
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 084cd20 | Docs | Datadog PR Page | Give us feedback! |
gogusarov
commented
May 12, 2026
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
8a5af9b to
5bef505
Compare
gogusarov
commented
May 13, 2026
Collaborator
|
can you edit the PR title to follow our convention please! |
2a0d867 to
3c37331
Compare
3c37331 to
df72f91
Compare
mormubis
reviewed
May 19, 2026
| })), | ||
| track_feature_flags_for_events: configuration.trackFeatureFlagsForEvents, | ||
| remote_configuration_id: configuration.remoteConfigurationId, | ||
| remote_configuration_id: configuration.remoteConfigurationId ?? configuration.remoteConfiguration?.id, |
Contributor
There was a problem hiding this comment.
remote_configuration_id resolves the ID in the opposite order from getRemoteConfigurationId. I'd use the helper here too:
remote_configuration_id: getRemoteConfigurationId(configuration),Nobody would pass both options, but this way there's a single source of truth for the resolution. What do you think?
There was a problem hiding this comment.
I can only run on private repositories.
mormubis
approved these changes
May 19, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Motivation
Support remote configuration asynchronous loading & caching mechanism according to the RFC
Changes
Added async remote configuration fetching flow where config isn't awaited during
DD_RUM.initbut read synchronously from a versioned localStorage cache (dd_rc_<remoteConfigurationId>) and applied on the same page load. A background fetch runs in parallel and refreshes the cache for the next page load, so updates roll out one load late but startup is unblocked. Cache outcomes (hit/miss/error) and fetch outcomes (success/failure) are reported via the existing telemetry metrics. Unit tests cover the new cache module and the read/apply/fetch flow; the e2e scenarios were rewritten to wait for the cache to be populated and reload the page before asserting.Blocking fetch flow was kept for backward compatibility with existing customer setup
New init configuration API
remoteConfiguration: { id: string; sync?: boolean }— new top-level field.Default behavior is async (cache-and-reload). Pass
sync: trueto opt into thelegacy blocking fetch through the new API.
remoteConfigurationId: string— legacy field preserved for backwardcompatibility with existing customer setups. Always triggers the blocking fetch
flow.
Test instructions
remote-config.jsonfile to sandbox directoryDD_RUM.initaddingremoteConfiguration: { id: 'remote-config-test' },remoteConfigurationProxy: '/remote-config.json'DD_RUM.getInitConfiguration()returns initial configuration on the first page loadDD_RUM.getInitConfiguration()returns remote configuration on the second page loadChecklist