Skip to content

localStorage strategy for remote configuration#4071

Draft
mormubis wants to merge 10 commits intomainfrom
adlrb/remote-config-localstorage
Draft

localStorage strategy for remote configuration#4071
mormubis wants to merge 10 commits intomainfrom
adlrb/remote-config-localstorage

Conversation

@mormubis
Copy link
Contributor

@mormubis mormubis commented Jan 9, 2026

Motivation

Remote configuration does not support localStorage, which is beneficial for some customers.

Changes

This PR adds the localStorage strategy for remote configuration.

Test instructions

TBD

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Jan 9, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 167.98 KiB 168.22 KiB +251 B +0.15%
Rum Profiler 4.31 KiB 4.31 KiB 0 B 0.00%
Rum Recorder 24.54 KiB 24.54 KiB 0 B 0.00%
Logs 56.25 KiB 56.25 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 124.88 KiB 125.12 KiB +251 B +0.20%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
addglobalcontext N/A 0.0104 N/A
addaction N/A 0.025 N/A
adderror N/A 0.017 N/A
addtiming N/A 0.0045 N/A
startview N/A 0.0065 N/A
startstopsessionreplayrecording N/A 0.001 N/A
logmessage N/A 0.0189 N/A
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
addglobalcontext N/A 27.81 KiB N/A
addaction N/A 52.11 KiB N/A
addtiming N/A 28.07 KiB N/A
adderror N/A 58.19 KiB N/A
startstopsessionreplayrecording N/A 25.64 KiB N/A
startview N/A 431.27 KiB N/A
logmessage N/A 46.81 KiB N/A

🔗 RealWorld

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 9, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 54.55%
Overall Coverage: 77.21% (-0.04%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a8d262d | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@mormubis mormubis force-pushed the adlrb/remote-config-localstorage branch from 9e8e512 to 94d9a59 Compare January 30, 2026 09:10
@mormubis
Copy link
Contributor Author

@codex review

@DataDog DataDog deleted a comment from chatgpt-codex-connector bot Jan 30, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@mormubis mormubis changed the title feat: add localStorage strategy to remote config localStorage strategy for remote configuration Feb 2, 2026
mormubis and others added 10 commits February 4, 2026 10:23
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>
@mormubis mormubis force-pushed the adlrb/remote-config-localstorage branch from c812560 to a8d262d Compare February 4, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant