Skip to content

fix(persistence): port poll DAO null-user fix and chunked size guard from #2731#2752

Merged
VelikovPetar merged 2 commits into
v9from
fix/port-pr-2731-remarks-to-v9
Jun 23, 2026
Merged

fix(persistence): port poll DAO null-user fix and chunked size guard from #2731#2752
VelikovPetar merged 2 commits into
v9from
fix/port-pr-2731-remarks-to-v9

Conversation

@VelikovPetar

Copy link
Copy Markdown
Contributor

Linear: FLU-
Github Issue: #

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

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 the v9 branch directly.

  • PollDao: switch the user side of the polls LEFT JOIN users read from readTable(users) to readTableOrNull(users) in both _pollFromJoinRow and getPollsByIds, and make userEntity nullable 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(): throw ArgumentError when size <= 0 instead of looping forever / producing nonsense chunks.
  • Adds a unit test file for 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.

Before After
getPollById / getPollsByIds throws when the creator user row is absent. Returns the poll with createdBy: null.

…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>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4337e413-3277-4be0-8412-8458e2f55709

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/port-pr-2731-remarks-to-v9

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 Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v9@fa471c5). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v9    #2752   +/-   ##
=====================================
  Coverage      ?   65.98%           
=====================================
  Files         ?      425           
  Lines         ?    26952           
  Branches      ?        0           
=====================================
  Hits          ?    17784           
  Misses        ?     9168           
  Partials      ?        0           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VelikovPetar VelikovPetar merged commit 75984e3 into v9 Jun 23, 2026
24 checks passed
@VelikovPetar VelikovPetar deleted the fix/port-pr-2731-remarks-to-v9 branch June 23, 2026 11:52
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