Skip to content

fix: await missing repository saves#2760

Open
0xSysR3ll wants to merge 1 commit intodevelopfrom
0xsysr3ll/fix/await-repository-saves
Open

fix: await missing repository saves#2760
0xSysR3ll wants to merge 1 commit intodevelopfrom
0xsysr3ll/fix/await-repository-saves

Conversation

@0xSysR3ll
Copy link
Copy Markdown
Contributor

@0xSysR3ll 0xSysR3ll commented Mar 25, 2026

Description

While working on something, I noticed the movie branch was calling save() without a proper await.

After fixing that, I did a quick grep for other Repository.save usages to make sure they were properly awaited (or intentionally handled with something like Promise.all).

I might've missed a few spots, but this should cover the obvious ones.

  • Fixes #XXXX

How Has This Been Tested?

Screenshots / Logs (if applicable)

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • Bug Fixes
    • Fixed data persistence issues affecting media request submissions, user notification preferences, and status management. All database operations now complete fully before confirming changes, improving reliability and preventing potential data loss.

@0xSysR3ll 0xSysR3ll requested a review from a team as a code owner March 25, 2026 21:55
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8c58a36-de9b-4168-8b71-40621af3b6d4

📥 Commits

Reviewing files that changed from the base of the PR and between 5373da4 and 5d76ce5.

📒 Files selected for processing (3)
  • server/routes/request.ts
  • server/routes/user/usersettings.ts
  • server/subscriber/MediaRequestSubscriber.ts

📝 Walkthrough

Walkthrough

Three database persistence calls are updated to properly await asynchronous operations: two in route handlers and one in a subscriber. The subscriber change converts a forEach to a for...of loop to ensure sequential processing with awaiting.

Changes

Cohort / File(s) Summary
Route Handlers
server/routes/request.ts, server/routes/user/usersettings.ts
Added await to requestRepository.save() and userRepository.save() calls to ensure persistence completes before returning responses.
Subscriber
server/subscriber/MediaRequestSubscriber.ts
Replaced forEach with for...of loop to sequentially await seasonRequestRepository.save(season) for each season in updateParentStatus method.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Awaiting with care, three calls now wait,
No racing ahead through persistence's gate,
Sequential seasons, requests made right,
Async operations aligned, burning bright!

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: await missing repository saves' directly and clearly describes the main change: adding await calls to repository save operations that were missing them across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gauthier-th

This comment was marked as off-topic.

@fallenbagel

This comment was marked as off-topic.

@gauthier-th

This comment was marked as off-topic.

@fallenbagel fallenbagel modified the milestones: Next Release, v3.2.0 Mar 28, 2026
@fallenbagel fallenbagel enabled auto-merge (squash) March 29, 2026 23:10
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