DevTools marker disappears while another wrapper remains active

Open Beginner friendly
#389 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
tooling

Research direction

Start by locating the DatadogDevtools wrapper and its onClose() handling for the dd.dd_flag.devtools localStorage marker. Reproduce replacement within one OpenFeature domain and across two domains, then inspect the proposed regression cases. Done means the marker remains while any wrapper is active and is removed after the last wrapper closes.

Written by the indexing model from the issue text.

Description

I noticed that replacing one DatadogDevtools provider with another removes the DevTools marker from localStorage, even though the new provider is still active.
To reproduce:

  1. Register a provider wrapped in DatadogDevtools.
  2. Checking localStorage.getItem('dd.dd_flag.devtools') returns "enabled".
  3. Replace it with another provider wrapped in DatadogDevtools.
  4. Check the marker again and it returns null, but the new provider still evaluates flags successfully.
    I also tried registering wrappers in two separate OpenFeature domains. Replacing either one with an unwrapped provider removes the marker while the other wrapper is still active.
    I’d expect the marker to stick around until the last DevTools wrapper closes. It looks like each wrapper currently removes it when its own onClose() runs.
    I have a small fix and regression tests for both cases, including cleanup after the last wrapper closes. Happy to send a PR if that would be useful.
Dominant language
TypeScript
Stars
1
Forks
3
Avg merge
2d 11h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataDog/openfeature-js-client

All issues in DataDog/openfeature-js-client

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.