Skip to content

[Bug]: Deleting a project leaves its Design Browser history and viewport in localStorage #6353

Description

@roian6

What happened?

On current main, a successful project deletion removes the daemon project and open-design:project-tabs:v1:<projectId>, but leaves two Design Browser records in the browser profile:

  • od:design-browser:<projectId>:history:v1
  • od:design-browser:<projectId>:viewport:v1

The history record stores complete visited URLs plus titles and visit metadata, so deleted projects can leave stale browsing data in localStorage indefinitely. Failed deletion should continue preserving these records.

Steps to reproduce

  1. Open a project and use the Design Browser to visit a URL.
  2. Switch the Design Browser viewport to Tablet or Mobile.
  3. Confirm the project's history and viewport keys exist in localStorage.
  4. Delete the project successfully.
  5. Observe that the tab-state key is gone but both od:design-browser:<projectId>:* keys remain.

Expected behavior

After a successful project deletion, that project's Design Browser history and viewport records are removed together with the existing tab-state cache. If the daemon deletion fails, all three records are retained. Cleanup should remain scoped to the deleted project and be safe to repeat.

Version / platform

Current main 517f39acde402c1a7af2189167a8d6957a3dac71 (apps/web package 0.16.1); Linux source-level Vitest reproduction.

Additional context

A focused regression was RED on current main (1 failure, 21 passes) and GREEN with a throwaway minimal cleanup spike (22/22). The probe ran under Node 22 rather than the repository-required Node 24, so broader validation remains outstanding.

No production patch is proposed here yet: draft PR #6142 also edits deleteProject() and introduces workspace-scoped tab cache keys. The final implementation should reuse one owner for the Design Browser key builders and cleanup, and reconcile deletion scope with #6142 rather than race its same hunk.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions