Skip to content

fix: enforce one OnTrack login per account on link#18

Merged
Aarav261 merged 1 commit into
mainfrom
fix/enforce-one-ontrack-login-per-account
Jun 30, 2026
Merged

fix: enforce one OnTrack login per account on link#18
Aarav261 merged 1 commit into
mainfrom
fix/enforce-one-ontrack-login-per-account

Conversation

@Aarav261

Copy link
Copy Markdown
Owner

Two Clerk accounts linking the same OnTrack username created duplicate user rows (username isn't a unique key). /ingest resolves by username alone, so it could write captured tasks to the wrong row, while /api/snapshot — resolved by Clerk id — read the other and showed nothing.

On /link-ontrack, after the account's row is established, evict any other rows holding the same username (and their captured tasks/projects), dropping their orphaned brief jobs. Last verified OnTrack linker wins; idempotent once a single row remains, so it also self-heals existing duplicates on next popup open.

Summary

Related issue

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

Checklist

  • My branch is based on the latest main
  • ruff check . passes
  • pytest passes (if backend changes)
  • npm run lint passes in extension/ (if extension changes)
  • I added/updated tests where it makes sense
  • I did not commit secrets, .env files, tokens, or database files

Notes for reviewers

Two Clerk accounts linking the same OnTrack username created duplicate user
rows (username isn't a unique key). /ingest resolves by username alone, so it
could write captured tasks to the wrong row, while /api/snapshot — resolved by
Clerk id — read the other and showed nothing.

On /link-ontrack, after the account's row is established, evict any other rows
holding the same username (and their captured tasks/projects), dropping their
orphaned brief jobs. Last verified OnTrack linker wins; idempotent once a single
row remains, so it also self-heals existing duplicates on next popup open.
Copilot AI review requested due to automatic review settings June 30, 2026 06:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Aarav261 Aarav261 merged commit 5055bda into main Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants