🤖 localStorage budgets: bound user-input-sized values at their producers (policy follow-ups from #5225)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- desktop, developer-experience
Direzione di ricerca
Start with the budget policy in src/common/constants/storage.ts, then trace the producers named in the issue, including useWorkspaceName.ts, FileTree state, and migrateWorkspaceStorage. Confirm each owner’s oversized-value behavior and identify the restore or migration paths that need coverage. Done means all six instances have an agreed bounded producer or migration behavior and tests for persistence and restoration.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #5225. The priority instance there (the creation draft list) moved to the backend (#5232, #5234), and #5225 closes with a documented budget policy (registry comment in src/common/constants/storage.ts): a key's budget must cover the largest value its owner writes, and an owner whose value grows with user input bounds it where it is produced. The session-only fallback for an over-budget value is a safety net, not a supported path.
These known instances break that policy. Each one needs a valid but rare input. On a hit, the newest value lives in memory for the session, and a restart restores the last value that fit.
Instances and recommended fix shape
selectedWorkspace(global, 2048). The value embedsprojectPath,projectNameandnamedWorkspacePath, so very long paths push it over. Recommended: persist only the workspace id and re-derive the rest from metadata on restore (a behavior change with a restore path to test).workspaceNameStatefor creation drafts (4096). A message of 2000 raw chars or fewer that is heavy in JSON escapes can serialize over.lastGeneratedForis already capped by raw length, butmanualName(a name the user typed) has no length bound. A typed name over ~4 KB would be lost after a restart, so this is the one item that touches typed input. Recommended: bound both by serialized length at the producer (useWorkspaceName.ts).model:{ws}(per workspace, 128). A custom provider model id longer than about 126 chars. Recommended: persist a bounded reference, or validate custom model id length where it is entered. Raising the budget costs ×210 in the budget model.statusState:{ws}(per workspace, 512). Astatus_setwith a long URL. Recommended: bound the URL (or drop it) when the status is stored.- File-tree expansion (per workspace, 512). FileTree keeps its full expansion map only in component state and persists the newest overrides that fit. After the Review panel remounts, 13 of 82 expanded folders were restored in remote UAT. Recommended: lift the live map to a per-workspace module store (session scope); the persisted part stays bounded.
migrateWorkspaceStorageof an oversized legacy value. The source is kept, but the destination copy is session-only and nothing retries the migration. Recommended: persist a bounded transform at the destination, or record the migration as incomplete and retry it.
None of 1, 3, 4, 5 or 6 loses typed input: they are preferences or UI state, and item 6 keeps its source. Item 2 does for a manual name over ~4 KB.
Refs #5225
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $13.71
- Lingua principale
- TypeScript
- Stelle
- 2.1k
- Fork
- 142
- Merge medio
- 4h 59m
- PR unite (30g)
- 902
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/xum
-
tech-debt
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
approved backlog
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
approved backlog
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jessepollak/home#2223 ·
I maintainer di solito rispondono entro 1 giorno
-
grep fixture corpus test follows the corpus's loop symlink under the receipt runner (fails on main)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
code-yeongyu/senpi#3756 ·
I maintainer di solito rispondono entro 1 giorno
-
org:external package:deepagents priority:triage topic:memory topic:middleware type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
langchain-ai/deepagents#7059 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
osmlab/name-suggestion-index#12992 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
hemilabs/ui-monorepo#2506 ·
I maintainer di solito rispondono entro 1 giorno