Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature-flag caches survive updateConfig API endpoint changes

Aperta
#1,090 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript

Direzione di ricerca

Start at BaseFlagsManager.updateConfig() and the existing context-change check (clientId, environment, user), plus the cache-clear and request-generation guards it invokes. Locate the four unit regression tests for endpoint changes, failed replacements, late responses and default-URL equivalence, and the Chromium feature-flag browser persistence tests. Note that an external prepared commit (a5118325) already covers this and awaits maintainer acceptance — confirm with the maintainer before starting, since done means those regressions pass with apiUrl included in the effective-context comparison.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

BaseFlagsManager.updateConfig() treats a change to clientId, environment, or user as a new evaluation context, but does not treat a change to apiUrl the same way. With the same client and user, switching servers keeps the previous server's flag values in memory and browser storage. A late response from the old server can also overwrite values fetched from the new one.

To Reproduce

  1. Create a server or browser flags manager with a client ID and an initial API URL, and fetch an enabled flag from that endpoint.
  2. Call manager.updateConfig({ clientId: "same-client", apiUrl: "https://second.example" }) without changing the client or user.
  3. Inspect getSnapshot().flags or getMemoryFlags(): the old endpoint's flags remain. If the new endpoint returns 503, they still remain after an explicit refresh.
  4. Alternatively, delay a bulk response from the first endpoint, switch to the second endpoint and fetch its flags, then release the first response. The old response replaces the second endpoint's flags.

The URLs above represent intercepted test endpoints, not public services used for this report.

Expected behavior

Changing the effective API URL should clear the previous evaluation state and browser persistence, and invalidate requests from the previous endpoint. Reads should use the new endpoint. Making the default URL explicit should preserve the existing cache.

Screenshots

Not applicable. Regression assertions inspect the returned flag values and browser storage.

Environment (please complete the following information):

  • OS: macOS arm64
  • Browser: Chromium 148.0.7778.96 for the browser regression
  • Runtime: Bun 1.4.1, pinned by the repository
  • SDK source: current staging, based on 89f418889b394d66754fdf31f2b0472a2372f10d

Additional context

A local patch adds the effective API URL comparison to the existing context-change check. It reuses the cache clear and request-generation guards. Four unit regressions cover endpoint changes, failed replacements, late responses and equivalent default URLs; a Chromium regression covers browser persistence.

Prepared change: commit a5118325b441b7e25302393db3ca8fa09be02737 on Iflaqbhat:codex/flags-api-url-cache. No PR has been submitted; maintainer acceptance and contributor code review are pending.

Three regressions failed against the original implementation. With the patch, SDK unit tests (93), Chromium feature-flag tests (31), repository lint, 37 typecheck tasks and the standard root test run pass. Optional database integration suites were not enabled.

The contributor also manually ran the built Node SDK against synthetic loopback HTTP endpoints: the initial value was first, switching endpoints immediately cleared the snapshot before returning second, and switching to an endpoint returning 503 left the flags empty. All checks completed successfully.

Would you accept a focused external contribution for this behavior against staging? No matching issue or overlapping open PR was found during the check on 2026-10-06.

AI usage disclosure

OpenAI Codex identified the bug, implemented the local patch, added tests and ran automated verification. The contributor completed the local Node SDK manual check described above. Contributor code review remains pending before any PR submission.

Lingua principale
TypeScript
Stelle
1.2k
Fork
227
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.