Feat/fix partials#13
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens async behavior across the persistence layer and auth use-cases, and adds a dedicated TypeScript typecheck script/dependency to support static validation in the Bun-based server codebase.
Changes:
- Make several repository
save/delete/updatemethods explicitlyawaitDrizzle operations insidewithDbErrorcallbacks to align return types withPromise<void>. - Change
forgot-passwordandresend-verificationuse-cases toawaitemail sending withtry/catch(instead of fire-and-forget.catch). - Add a
typecheckscript and addtypescriptto devDependencies (and lockfile).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/server/infrastructure/persistence/verification-token.pg.repository.ts | Ensure delete operations resolve to Promise<void> under withDbError. |
| src/server/infrastructure/persistence/user.pg.repository.ts | Ensure update/delete operations resolve to Promise<void> under withDbError. |
| src/server/infrastructure/persistence/token.pg.repository.ts | Ensure insert/delete operations are awaited to match Promise<void> contracts. |
| src/server/infrastructure/persistence/role.pg.repository.ts | Ensure role assignment/removal resolves to Promise<void> under withDbError. |
| src/server/infrastructure/persistence/password-reset-token.pg.repository.ts | Ensure insert/delete operations are awaited to match Promise<void> contracts. |
| src/server/core/use-cases/auth/resend-verification.ts | Await verification email send with try/catch instead of fire-and-forget. |
| src/server/core/use-cases/auth/forgot-password.ts | Await password reset email send with try/catch instead of fire-and-forget. |
| package.json | Add typecheck script and add TypeScript devDependency. |
| bun.lock | Lockfile update for the new TypeScript dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+50
to
+58
| try { | ||
| await this.emailService.sendVerificationEmail(user.email, user.name, token); | ||
| } catch (err) { | ||
| console.error( | ||
| "[ResendVerificationUseCase] Failed to send verification email to:", | ||
| user.email, | ||
| err, | ||
| ); | ||
| } |
Comment on lines
+40
to
+48
| try { | ||
| await this.emailService.sendPasswordResetEmail(user.email, user.name, token); | ||
| } catch (err) { | ||
| console.error( | ||
| "[ForgotPasswordUseCase] Failed to send password reset email to:", | ||
| user.email, | ||
| err, | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.