Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use prisma accounts in backend #1109

Merged
merged 53 commits into from
Aug 13, 2024
Merged

Use prisma accounts in backend #1109

merged 53 commits into from
Aug 13, 2024

Conversation

malteish
Copy link
Collaborator

@malteish malteish commented Jul 17, 2024

see #1091

  • store accounts in prisma instead of redis in backend
  • add scripts and notes for manual migration of existing accounts (formerly sessions) from redis to prisma
  • separate profile management in backend and delivery service, as the overlap now is negligible
  • extend account table to include created at
  • clean up libraries, improving structure. server-side and delivery saw most changes and have been detangled significantly.
  • we used to have 2 files named Auth.ts and auth.ts. Imo Auth.ts handles authentication and is currently still called Auth.ts, while auth.ts handles authorization and has been renamed to authorize.ts. This starts a cleanup process that will be continued later, but this PR is already large enough.
  • move socketAuth to delivery-service (from server-side), because it is used only there

@malteish malteish changed the base branch from testing to develop July 18, 2024 11:45
@malteish
Copy link
Collaborator Author

@malteish malteish marked this pull request as ready for review August 8, 2024 12:36
@malteish
Copy link
Collaborator Author

malteish commented Aug 9, 2024

I tested the full migration process on testing, and it worked nicely. Here are my notes from the test:

  • no backend accounts or sessions
  • - sign up with account 1 -> 2 signatures 
  • - sign up with account 2 -> 2 signatures
  • - send message between account 1 and account 2
  • - backend has 2 accounts 
  • - sign up with account 3 -> 2 signatures
  • - backend has 3 sessions
  • - accounts have no createdAt
  • - deploy new version
  • - backend has accounts created at 'now', and sessions
  • - sign in with account 1 -> 1 signature
  • - extract sessions
  • - overwrite accounts
  • - the account's createdAt now corresponds to the session's createdAt
  • - sign in with account 2 -> 1 signature
  • - sign in with account 3 -> 1 signature
  • - send messages between accounts -> works
  • - sign up with account 4 -> 2 signatures
  • - 4 accounts, 3 sessions

We are ready to to this on staging and production next week.

@malteish malteish merged commit a47010b into develop Aug 13, 2024
17 checks passed
@malteish malteish deleted the usePrismaAccountsInBackend branch August 13, 2024 08:41
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