Skip to content

Fix: Set hasSequentialIdsMigrated=true for new personal organizations#1998

Merged
DonKoko merged 2 commits intomainfrom
copilot/fix-1997
Aug 22, 2025
Merged

Fix: Set hasSequentialIdsMigrated=true for new personal organizations#1998
DonKoko merged 2 commits intomainfrom
copilot/fix-1997

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 22, 2025

When a new user registers, their personal organization was created with hasSequentialIdsMigrated=false, causing the sequential ID migration modal to appear unnecessarily on first login. This created a poor user experience where new users were prompted to run a migration they didn't need.

Problem

The hasSequentialIdsMigrated field in the Prisma schema defaults to false. The migration modal is triggered when:

  1. User is an owner or admin, AND
  2. Organization's hasSequentialIdsMigrated is false

In /app/modules/user/service.server.ts, the createUser function creates personal organizations without explicitly setting this flag, causing it to default to false and trigger unnecessary migrations.

Solution

This PR adds hasSequentialIdsMigrated: true to personal organization creation in the createUser function, maintaining consistency with how team organizations are created in the createOrganization function.

Changes:

  • app/modules/user/service.server.ts: Set hasSequentialIdsMigrated: true for new personal organizations
  • app/modules/user/service.server.test.ts: Update test expectations to include the new flag

Impact

  • Before: New users saw migration prompts on first login
  • After: New users have smooth onboarding without migration interruptions
  • Existing organizations: Unaffected - still trigger migration when needed
  • Consistency: Personal and team organizations now behave identically

The fix is minimal and surgical, addressing exactly the issue described without affecting existing functionality.

Fixes #1997.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • binaries.prisma.sh
    • Triggering command: node scripts/postinstall.js (dns block)
    • Triggering command: node /home/REDACTED/work/shelf.nu/shelf.nu/node_modules/.bin/prisma -v (dns block)
    • Triggering command: node /home/REDACTED/work/shelf.nu/shelf.nu/node_modules/.bin/prisma generate (dns block)
  • checkpoint.prisma.io
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/shelf.nu/shelf.nu/node_modules/prisma/build/child {"product":"prisma","version":"6.14.0","cli_install_type":"local","information":"","local_timestamp":"2025-08-22T14:37:23Z","project_hash":"e6fa372b","cli_path":"/home/REDACTED/work/shelf.nu/shelf.nu/node_modules/.bin/prisma","cli_path_hash":"39199cc4","endpoint":"REDACTED","disable":false,"arch":"x64","os":"linux","node_version":"v20.19.4","ci":true,"ci_name":"GitHub Actions","command":"generate","schema_providers":["postgresql"],"schema_preview_features":["fullTextSearchPostgres"],"schema_generators_providers":["prisma-client-js"],"cache_file":"/home/REDACTED/.cache/checkpoint-nodejs/prisma-39199cc4","cache_duration":43200000,"remind_duration":172800000,"force":false,"timeout":5000,"unref":true,"child_path":"/home/REDACTED/work/shelf.nu/shelf.nu/node_modules/prisma/build/child","client_event_id":"","previous_client_event_id":"","check_if_update_available":true} (dns block)
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/shelf.nu/shelf.nu/node_modules/prisma/build/child {"product":"prisma","version":"6.14.0","cli_install_type":"local","information":"","local_timestamp":"2025-08-22T14:40:52Z","project_hash":"e6fa372b","cli_path":"/home/REDACTED/work/shelf.nu/shelf.nu/node_modules/.bin/prisma","cli_path_hash":"39199cc4","endpoint":"REDACTED","disable":false,"arch":"x64","os":"linux","node_version":"v20.19.4","ci":true,"ci_name":"GitHub Actions","command":"generate","schema_providers":["postgresql"],"schema_preview_features":["fullTextSearchPostgres"],"schema_generators_providers":["prisma-client-js"],"cache_file":"/home/REDACTED/.cache/checkpoint-nodejs/prisma-39199cc4","cache_duration":43200000,"remind_duration":172800000,"force":false,"timeout":5000,"unref":true,"child_path":"/home/REDACTED/work/shelf.nu/shelf.nu/node_modules/prisma/build/child","client_event_id":"","previous_client_event_id":"","check_if_update_available":true} (dns block)
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/shelf.nu/shelf.nu/node_modules/prisma/build/child {"product":"prisma","version":"6.14.0","cli_install_type":"local","information":"","local_timestamp":"2025-08-22T14:41:04Z","project_hash":"e6fa372b","cli_path":"/home/REDACTED/work/shelf.nu/shelf.nu/node_modules/.bin/prisma","cli_path_hash":"39199cc4","endpoint":"REDACTED","disable":false,"arch":"x64","os":"linux","node_version":"v20.19.4","ci":true,"ci_name":"GitHub Actions","command":"generate","schema_providers":["postgresql"],"schema_preview_features":["fullTextSearchPostgres"],"schema_generators_providers":["prisma-client-js"],"cache_file":"/home/REDACTED/.cache/checkpoint-nodejs/prisma-39199cc4","cache_duration":43200000,"remind_duration":172800000,"force":false,"timeout":5000,"unref":true,"child_path":"/home/REDACTED/work/shelf.nu/shelf.nu/node_modules/prisma/build/child","client_event_id":"","previous_client_event_id":"","check_if_update_available":true} (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link
Copy Markdown

vercel bot commented Aug 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
shelf-docs Ignored Ignored Preview Aug 22, 2025 2:43pm

Copilot AI changed the title [WIP] Fix: New personal organizations should have the flag for sequential ids generated set to true Fix: Set hasSequentialIdsMigrated=true for new personal organizations Aug 22, 2025
Copilot AI requested a review from DonKoko August 22, 2025 14:44
@DonKoko DonKoko marked this pull request as ready for review August 22, 2025 14:55
@DonKoko DonKoko merged commit 156ff3e into main Aug 22, 2025
10 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.

Fix: New personal organizations should have the flag for sequential ids generated set to true

2 participants