Skip to content

Stop rating dialog reloads wiping edits - #1867

Merged
KOliver94 merged 2 commits into
mainfrom
rating-dialog-reload
Oct 20, 2026
Merged

KOliver94 merged 2 commits into
mainfrom
rating-dialog-reload

Conversation

@KOliver94

Copy link
Copy Markdown
Member

The admin rating dialog could throw away what was typed into it. Saving a new rating refetches the video, which flips its is_rated flag. The dialog reloaded its rating whenever that flag changed, even while it was open, and the late load reset the form over whatever the user had typed after saving. This also made concurrent-edits.spec.ts › a rating edit sends only the changed field flaky: it failed on main whenever the reload landed between typing and saving, and the PATCH went out empty.

What changes

  • The video page's ratings section passes the dialog isRated as it was when the dialog opened, so the dialog's own save no longer triggers a reload. The videos table already did this.
  • The dialog now stays in its loading state until the rating has loaded: the spinner shows and the fields stay disabled, so nothing can be typed into a form that is about to be reset. Before, loading was cleared right after the request started. Loading now also ends when the request fails or is cancelled because the dialog closed, so the next opening is not stuck disabled.

Notes for reviewers

  • The dialog itself still reloads if a parent passes a live isRated. Both parents now freeze it at open; moving the "load once per opening" rule into the dialog would be a bigger rewrite of its effect.
  • While the rating loads, "Mentés" also shows its spinner, because loading and saving share one flag.
  • Repeating the e2e test locally can't show the flake, since the seeded data isn't reset between repeats. I reproduced it with a temporary spec that delays the own-rating request, which failed before this change and passes after it, and checked the loading state the same way.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9daeaaf5-027f-4e20-9abe-bc130dc646bb
📥 Commits

Reviewing files that changed from the base of the PR and between 80ecb32 and 87d4c01.

📒 Files selected for processing: 2
  • frontend/src/admin/components/Details/Video/Ratings.tsx
  • frontend/src/admin/components/RatingDialog/RatingDialog.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.41%. Comparing base (74aab79) to head (87d4c01).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...src/admin/components/RatingDialog/RatingDialog.tsx 0.00% 3 Missing ⚠️
...end/src/admin/components/Details/Video/Ratings.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1867      +/-   ##
==========================================
+ Coverage   43.29%   43.41%   +0.12%     
==========================================
  Files         282      282              
  Lines        7248     7267      +19     
  Branches     1458     1459       +1     
==========================================
+ Hits         3138     3155      +17     
- Misses       4089     4091       +2     
  Partials       21       21              
Flag Coverage Δ
backend 97.73% <ø> (+0.01%) ⬆️
frontend 5.09% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KOliver94
KOliver94 enabled auto-merge (squash) October 20, 2026 11:17
@KOliver94
KOliver94 merged commit d1f61e2 into main Oct 20, 2026
15 checks passed
@KOliver94
KOliver94 deleted the rating-dialog-reload branch October 20, 2026 11:18
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.

1 participant