chore(persistence): Remove unused DAO methods#2695
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughConsolidates persistence DAOs to bulk map-based update APIs, removes several single-channel wrappers and unused list/query methods, and updates tests to seed and verify data using the new bulkUpdate* map payloads. ChangesDAO API and Test Consolidation
🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/stream_chat_persistence/test/src/dao/user_dao_test.dart (1)
57-80:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMake the upsert assertion deterministic.
At Line 62 and Line 79, forcing
online: falsecan hide an upsert regression when the seeded value is alreadyfalse. Toggle from the original value so the update is always validated.Suggested patch
- final copyUser = insertedUsers.first.copyWith(online: false); + final toggledOnline = !insertedUsers.first.online; + final copyUser = insertedUsers.first.copyWith(online: toggledOnline); @@ - expect(fetchedUsers.firstWhere((it) => it.id == copyUser.id).online, false); + expect( + fetchedUsers.firstWhere((it) => it.id == copyUser.id).online, + toggledOnline, + );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/stream_chat_persistence/test/src/dao/user_dao_test.dart` around lines 57 - 80, The test's upsert assertion can be non-deterministic because it forces copyUser.online = false even if the seeded user was already false; change the update to toggle the original user's online value so the update always changes state: locate where you create copyUser using insertedUsers.first.copyWith(...) and set online to the negation of the original (e.g., !insertedUsers.first.online) before calling userDao.updateUsers([...]), then keep the subsequent checks using _readPersistedUsers and expectations on copyUser and newUser.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@packages/stream_chat_persistence/test/src/dao/user_dao_test.dart`:
- Around line 57-80: The test's upsert assertion can be non-deterministic
because it forces copyUser.online = false even if the seeded user was already
false; change the update to toggle the original user's online value so the
update always changes state: locate where you create copyUser using
insertedUsers.first.copyWith(...) and set online to the negation of the original
(e.g., !insertedUsers.first.online) before calling userDao.updateUsers([...]),
then keep the subsequent checks using _readPersistedUsers and expectations on
copyUser and newUser.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 312b532f-4787-4564-9846-6278f78ea79a
📒 Files selected for processing (16)
packages/stream_chat_persistence/lib/src/dao/member_dao.dartpackages/stream_chat_persistence/lib/src/dao/message_dao.dartpackages/stream_chat_persistence/lib/src/dao/pinned_message_dao.dartpackages/stream_chat_persistence/lib/src/dao/poll_dao.dartpackages/stream_chat_persistence/lib/src/dao/read_dao.dartpackages/stream_chat_persistence/lib/src/dao/user_dao.dartpackages/stream_chat_persistence/test/src/dao/channel_dao_test.dartpackages/stream_chat_persistence/test/src/dao/draft_message_dao_test.dartpackages/stream_chat_persistence/test/src/dao/member_dao_test.dartpackages/stream_chat_persistence/test/src/dao/message_dao_test.dartpackages/stream_chat_persistence/test/src/dao/pinned_message_dao_test.dartpackages/stream_chat_persistence/test/src/dao/pinned_message_reaction_dao_test.dartpackages/stream_chat_persistence/test/src/dao/poll_dao_test.dartpackages/stream_chat_persistence/test/src/dao/reaction_dao_test.dartpackages/stream_chat_persistence/test/src/dao/read_dao_test.dartpackages/stream_chat_persistence/test/src/dao/user_dao_test.dart
💤 Files with no reviewable changes (5)
- packages/stream_chat_persistence/lib/src/dao/member_dao.dart
- packages/stream_chat_persistence/lib/src/dao/message_dao.dart
- packages/stream_chat_persistence/lib/src/dao/user_dao.dart
- packages/stream_chat_persistence/lib/src/dao/read_dao.dart
- packages/stream_chat_persistence/lib/src/dao/poll_dao.dart
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2695 +/- ##
==========================================
- Coverage 65.38% 65.33% -0.06%
==========================================
Files 423 423
Lines 26664 26612 -52
==========================================
- Hits 17435 17386 -49
+ Misses 9229 9226 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… test Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Submit a pull request
Linear: FLU-501
CLA
Description of the pull request
Summary by CodeRabbit
Refactor
Tests