-
Notifications
You must be signed in to change notification settings - Fork 0
Fix processing of updates in MemberListState
#93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes MemberListState update logic to enforce sorting and to process added members during batch updates, ensuring member lists remain correctly ordered after add/update operations.
- Enforces sorted insertion/repositioning using upsertSorted and explicit sorting with CompositeComparator
- Processes added members in ModelUpdates (previously ignored) and updates tests to validate ordering and repositioning
- Refactors tests to use deterministic createdAt values and a helper for initial state setup
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
MemberListStateImpl.kt | Adds sorted upsert logic for single and batch updates; processes added members and re-sorts list |
MemberListStateImplTest.kt | Updates/extends tests to cover sorting, added members in batch updates, and repositioning logic; adds helper |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../src/test/kotlin/io/getstream/feeds/android/client/internal/state/MemberListStateImplTest.kt
Outdated
Show resolved
Hide resolved
...ient/src/main/kotlin/io/getstream/feeds/android/client/internal/state/MemberListStateImpl.kt
Show resolved
Hide resolved
SDK Size Comparison 📏
|
39ebb32
to
26e47a0
Compare
|
Goal
The current logic to add/update members into
MemberListState
has two flaws:added
members on batch updatesThi PR fixes that.
Implementation
Handle
added
members for batch updates & enforce sortingTesting
Testing manually it's not trivial, but there are now unit tests exercising that behavior.
Checklist