✨ localStorage strategy for remote configuration#4071
Draft
✨ localStorage strategy for remote configuration#4071
localStorage strategy for remote configuration#4071Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage 🔗 Commit SHA: a8d262d | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
9e8e512 to
94d9a59
Compare
Contributor
Author
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94d9a591b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
localStorage strategy for remote configuration
Add 4 new E2E tests for the localStorage strategy: 1. Basic localStorage retrieval - reads simple string values 2. localStorage with regex extractor - parses extracted values 3. Missing key handling - gracefully falls back when key doesn't exist 4. localStorage unavailable - handles access errors and falls back Tests follow the same pattern as the js strategy tests (PR #3766) and validate: - Synchronous value resolution during SDK initialization - Regex extraction functionality - Fallback behavior for missing or inaccessible keys - Integration with both CDN and npm setups Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
When a remote configuration value fails to resolve (e.g., localStorage key is missing or access fails), the system now preserves the initial configuration fallback value instead of overwriting it with undefined. This fixes the issue where the SDK would lose the fallback version when: - localStorage key is not found - localStorage access throws an error - Any other dynamic resolution returns undefined The fix adds an undefined check before assigning resolved values, ensuring that undefined values do not override the initial configuration. Fixes E2E tests: - should resolve to undefined when localStorage key is missing - should handle localStorage access failure gracefully Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
c812560 to
a8d262d
Compare
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.
Motivation
Remote configuration does not support
localStorage, which is beneficial for some customers.Changes
This PR adds the
localStoragestrategy for remote configuration.Test instructions
TBD
Checklist