Skip to content

fix(server): store null instead of empty string for user oauthId#30157

Open
deveshkolte wants to merge 1 commit into
immich-app:mainfrom
deveshkolte:fix/28832-user-oauthid-null
Open

fix(server): store null instead of empty string for user oauthId#30157
deveshkolte wants to merge 1 commit into
immich-app:mainfrom
deveshkolte:fix/28832-user-oauthid-null

Conversation

@deveshkolte

Copy link
Copy Markdown

Description

When a user signs up via email (without OAuth), the database now stores NULL instead of an empty string "" for the OAuth ID column.

This was already marked with a TODO comment in the admin service:

// TODO replace  with null

Changes:

  • DB column: nullable with default NULL; migration updates existing rows
  • Response schemas (UserAdminResponse, SyncUserV1): allows null
  • Admin service: unlinkAll now sets to null instead of empty string
  • Auth service: unlink OAuth now sets to null instead of empty string
  • TypeScript types (UserAdmin, AuthUserEvent): oauthId is string | null

Fixes #28832 (user.oauthId column)

Checklist:

  • I have carefully read CONTRIBUTING.md
  • I have performed a self-review of my own code
  • I have no unrelated changes in the PR.
  • I have followed naming conventions/patterns in the surrounding code
  • I have written tests for new code (if applicable)

Please describe to which degree, if any, an LLM was used in creating this pull request.

None.

@immich-push-o-matic

Copy link
Copy Markdown

Label error. Requires exactly 1 of: changelog:.*. Found: 🗄️server. A maintainer will add the required label.

@timonrieger

Copy link
Copy Markdown
Collaborator

@deveshkolte please make sure to follow the guidelines made in the issue's pinned comment (and also apply it to your other PRs for that issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prefer null values over empty strings

2 participants