Skip to content

fix: migrate clients between localStorage and Supabase on auth change#155

Merged
AdamJ merged 2 commits into
mainfrom
claude/clients-storage-save-issue-TVVs7
May 31, 2026
Merged

fix: migrate clients between localStorage and Supabase on auth change#155
AdamJ merged 2 commits into
mainfrom
claude/clients-storage-save-issue-TVVs7

Conversation

@AdamJ
Copy link
Copy Markdown
Owner

@AdamJ AdamJ commented May 30, 2026

migrateFromLocalStorage and migrateToLocalStorage handled every entity
except clients, so a guest who added clients lost them on sign-in (never
pushed to Supabase) and an authenticated user's clients were never
written back to localStorage on sign-out.

  • migrateFromLocalStorage now reads guest clients, includes them in the
    early-return guard, and non-destructively upserts any whose name is not
    already on the account (clients synced from another device are kept).
  • migrateToLocalStorage now writes the account's clients to localStorage.

https://claude.ai/code/session_01Vj59LNCu4LCzWvm4myW4wC

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 30, 2026
migrateFromLocalStorage and migrateToLocalStorage handled every entity
except clients, so a guest who added clients lost them on sign-in (never
pushed to Supabase) and an authenticated user's clients were never
written back to localStorage on sign-out.

- migrateFromLocalStorage now reads guest clients, includes them in the
  early-return guard, and non-destructively upserts any whose name is not
  already on the account (clients synced from another device are kept).
- migrateToLocalStorage now writes the account's clients to localStorage.

https://claude.ai/code/session_01Vj59LNCu4LCzWvm4myW4wC
@AdamJ AdamJ force-pushed the claude/clients-storage-save-issue-TVVs7 branch from 7ac5b93 to 2097177 Compare May 31, 2026 12:51
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 31, 2026

Deploying timetrackerpro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d38c05
Status: ✅  Deploy successful!
Preview URL: https://d249a939.timetrackerpro.pages.dev
Branch Preview URL: https://claude-clients-storage-save.timetrackerpro.pages.dev

View logs

@AdamJ AdamJ added the fix For general fixes or bundled fixes label May 31, 2026
The waitFor condition (projects.length > 0) resolved immediately against
the initial default projects, before the async localStorage load ran. Move
the renamed-name assertion inside waitFor so it polls until the loaded
state is actually present.

https://claude.ai/code/session_01C2Az2Kf6VUGng8d3MtoXdN
@AdamJ AdamJ merged commit 445c1ae into main May 31, 2026
3 checks passed
@AdamJ AdamJ deleted the claude/clients-storage-save-issue-TVVs7 branch May 31, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation fix For general fixes or bundled fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants