Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🤖 localStorage budgets: bound user-input-sized values at their producers (policy follow-ups from #5225)

Open
#5,237 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

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.

Written by the indexing model from the issue text.

Description

approved backlog

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

  1. selectedWorkspace (global, 2048). The value embeds projectPath, projectName and namedWorkspacePath, 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).
  2. workspaceNameState for creation drafts (4096). A message of 2000 raw chars or fewer that is heavy in JSON escapes can serialize over. lastGeneratedFor is already capped by raw length, but manualName (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).
  3. 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.
  4. statusState:{ws} (per workspace, 512). A status_set with a long URL. Recommended: bound the URL (or drop it) when the status is stored.
  5. 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.
  6. migrateWorkspaceStorage of 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

Dominant language
TypeScript
Stars
2k
Forks
139
Avg merge
6h 35m
Merged PRs (30d)
819

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No 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 coder/xum

All issues in coder/xum

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.