fix(persistence): port poll DAO null-user fix and chunked size guard from #2731#2752
fix(persistence): port poll DAO null-user fix and chunked size guard from #2731#2752VelikovPetar wants to merge 1 commit into
Conversation
…from #2731 Cherry-picks the review fixes from PR #2731 (commit 15af740) onto v9: - PollDao: read users via readTableOrNull on the LEFT JOIN so polls whose creator user is missing from the local cache no longer crash. - chunked(): throw ArgumentError when size <= 0; add unit tests for chunked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v9 #2752 +/- ##
=======================================
Coverage 65.96% 65.96%
=======================================
Files 425 425
Lines 26926 26928 +2
=======================================
+ Hits 17761 17763 +2
Misses 9165 9165 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linear: FLU-
Github Issue: #
CLA
Description of the pull request
Ports the review fixes from #2731 (commit 15af740) onto
v9. These were applied during the merge-master-to-v10 PR but never landed on thev9branch directly.PollDao: switch the user side of thepolls LEFT JOIN usersread fromreadTable(users)toreadTableOrNull(users)in both_pollFromJoinRowandgetPollsByIds, and makeuserEntitynullable in_buildPoll. Without this, reading a poll whose creator user isn't in the local cache crashes (the LEFT JOIN legitimately returns no user row).chunked(): throwArgumentErrorwhensize <= 0instead of looping forever / producing nonsense chunks.chunked()covering the empty/single/even/partial/default-size cases plus the new zero/negative guards. All 7 tests pass locally (flutter test test/src/db/query_utils_test.dart).Screenshots / Videos
NA — persistence-layer change.
getPollById/getPollsByIdsthrows when the creator user row is absent.createdBy: null.