Skip to content

fix: replace Date.now() UUIDs with crypto.randomUUID() - #270

Merged
AdamJ merged 1 commit into
mainfrom
fix-multi-device-usage
Oct 12, 2026
Merged

AdamJ merged 1 commit into
mainfrom
fix-multi-device-usage

Conversation

@AdamJ

@AdamJ AdamJ commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Replace Date.now() UUIDs with crypto.randomUUID() to prevent sync collisions

Tasks and archived days used Date.now().toString() for IDs, causing collisions when multiple devices generated IDs at the same millisecond. Supabase upsert (onConflict: id) would overwrite task day_record_id values, severing archived days from their tasks.

Replaced Date.now().toString() with crypto.randomUUID() for task IDs, day IDs, project IDs, client IDs, and category IDs.

Summary

Type of Change

  • New feature
  • Update to existing feature
  • Bug fix
  • Documentation update
  • Other (describe below)

Related Issue

Closes #

Changes Made

Checklist

Complete all items that apply to your change. Check N/A for items that don't apply.

Documentation

Run sync-docs skill with Claude Code to automatically update relevant files.

  • Any notable changes added to the README.md
  • CHANGELOG.md updated accordingly
  • N/A — no README changes

General

  • Branch is up to date with main
  • No unrelated files included in this PR
  • Tested locally by invoking the pnpm test, pnpm lint, and pnpm build

Notes for Reviewers

…c collisions

Tasks and archived days used Date.now().toString() for IDs, causing
collisions when multiple devices generated IDs at the same millisecond.
Supabase upsert (onConflict: id) would overwrite task day_record_id
values, severing archived days from their tasks.

Replaced Date.now().toString() with crypto.randomUUID() for task IDs,
day IDs, project IDs, client IDs, and category IDs.
@AdamJ AdamJ added this to Timetraked Oct 12, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Timetraked Oct 12, 2026
@AdamJ AdamJ moved this from Backlog to In review in Timetraked Oct 12, 2026
@AdamJ AdamJ self-assigned this Oct 12, 2026
@AdamJ
AdamJ merged commit 237d8a6 into main Oct 12, 2026
2 of 3 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Timetraked Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant