Skip to content

Conversation

@capaj
Copy link
Collaborator

@capaj capaj commented Nov 6, 2025

Firebase doesn't work in browser extensions, so device.fireToken is always null. Instead of sending null or a placeholder value that could collide, generate a unique token using crypto.randomUUID() prefixed with 'web-ext-'.

This prevents unique constraint violations on the firebaseToken field when multiple devices or registration attempts use the same placeholder value.

Changes:

  • Register.tsx: Generate unique token if device.fireToken is null
  • LoginAwaitingApproval.tsx: Generate unique token if device.fireToken is null

The backend firebaseToken field is nullable and has a unique constraint, so this ensures each web extension device gets a unique token without backend changes.

Firebase doesn't work in browser extensions, so device.fireToken is always
null. Instead of sending null or a placeholder value that could collide,
generate a unique token using crypto.randomUUID() prefixed with 'web-ext-'.

This prevents unique constraint violations on the firebaseToken field when
multiple devices or registration attempts use the same placeholder value.

Changes:
- Register.tsx: Generate unique token if device.fireToken is null
- LoginAwaitingApproval.tsx: Generate unique token if device.fireToken is null

The backend firebaseToken field is nullable and has a unique constraint,
so this ensures each web extension device gets a unique token without
backend changes.
@capaj capaj merged commit afabac6 into main Nov 8, 2025
3 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.

3 participants