-
Notifications
You must be signed in to change notification settings - Fork 1
feat(llc): add batch follow and unfollow support #85
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
Conversation
- Add support for moderation appeals with new endpoints (`appeal`, `getAppeal`, `queryAppeals`) and related data models (`AppealRequest`, `AppealResponse`, etc.). - Update `SubmitActionRequest` and `SubmitActionResponse` to include appeal-related fields and actions. - Rename `OwnCapabilitiesBatch` to `OwnBatch` and update `CapabilitiesRepository` to use the more general `ownBatch` endpoint. - Add batch upsert support for follows and unfollows (`getOrCreateFollows`, `getOrCreateUnfollows`). - Expand `FeedResponse` and `FeedSuggestionResponse` with `activityCount` and `ownFollowings`. - Update `UpdateFeedRequest`, `UpdateActivityRequest`, and `UpdateCommentRequest` with additional configuration fields like `description`, `mentionedUserIds`, and `attachments`. - Enhance `RuleBuilderCondition` and `TextRuleParameters` with new moderation filter options (e.g., semantic filters, user roles, and identical content counts). - Add `individualRecording` and `rawRecording` settings to `CallSettingsResponse`. - Minor: remove redundant `super == other` checks in generated Freezed files and update test helpers.
- Add `getOrCreateFollows` and `getOrCreateUnfollows` to `FeedsClient`. - Implement batch follow/unfollow logic in `FeedsClientImpl` and `FeedsRepository`. - Introduce `FollowBatchUpdate` state update event to handle batch operations. - Enhance `ModelUpdates` with an `applyTo` extension for easier list state manipulation. - Update `FeedState`, `FollowListState`, and `MemberListState` to handle batch updates. - Switch `ModelUpdates.removedIds` from `List` to `Set` for better performance. - Add comprehensive tests for batch follow operations in `feeds_client_test.dart`.
📝 WalkthroughWalkthroughAdds batch follow and unfollow operations to the Stream Feeds package, introducing new client APIs ( Changes
Sequence DiagramssequenceDiagram
participant Client
participant StreamFeedsClient
participant FeedsRepository
participant API
participant StateUpdateEmitter
participant EventHandlers
participant FeedState
Client->>StreamFeedsClient: getOrCreateFollows(FollowBatchRequest)
activate StreamFeedsClient
StreamFeedsClient->>FeedsRepository: getOrCreateFollows(request)
activate FeedsRepository
FeedsRepository->>API: call batch follow API
activate API
API-->>FeedsRepository: FollowBatchResponse
deactivate API
FeedsRepository->>FeedsRepository: map response to BatchFollowData
FeedsRepository-->>StreamFeedsClient: Result<BatchFollowData>
deactivate FeedsRepository
StreamFeedsClient->>StreamFeedsClient: compute ModelUpdates from response
StreamFeedsClient->>StateUpdateEmitter: emit FollowBatchUpdate(updates)
activate StateUpdateEmitter
StateUpdateEmitter->>EventHandlers: route FollowBatchUpdate
activate EventHandlers
EventHandlers->>FeedState: onFollowsUpdated(updates)
activate FeedState
FeedState->>FeedState: classify adds by relation<br/>(follower/following/followRequest)
FeedState->>FeedState: apply updates to state lists
FeedState-->>EventHandlers: state updated
deactivate FeedState
deactivate EventHandlers
deactivate StateUpdateEmitter
StreamFeedsClient-->>Client: Result<BatchFollowData>
deactivate StreamFeedsClient
sequenceDiagram
participant Client
participant StreamFeedsClient
participant FeedsRepository
participant API
participant FollowListState
Client->>StreamFeedsClient: getOrCreateUnfollows(UnfollowBatchRequest)
activate StreamFeedsClient
StreamFeedsClient->>FeedsRepository: getOrCreateUnfollows(request)
activate FeedsRepository
FeedsRepository->>API: call batch unfollow API
activate API
API-->>FeedsRepository: UnfollowBatchResponse
deactivate API
FeedsRepository->>FeedsRepository: map response to List<FollowData>
FeedsRepository-->>StreamFeedsClient: Result<List<FollowData>>
deactivate FeedsRepository
StreamFeedsClient->>StreamFeedsClient: compute ModelUpdates<br/>with removedIds set
StreamFeedsClient->>FollowListState: emit FollowBatchUpdate
activate FollowListState
FollowListState->>FollowListState: applyTo() merge and remove
FollowListState->>FollowListState: sort by comparator
FollowListState-->>StreamFeedsClient: state updated
deactivate FollowListState
StreamFeedsClient-->>Client: Result<List<FollowData>>
deactivate StreamFeedsClient
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (53.33%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
==========================================
- Coverage 86.53% 85.92% -0.61%
==========================================
Files 121 122 +1
Lines 4196 4263 +67
==========================================
+ Hits 3631 3663 +32
- Misses 565 600 +35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ollow # Conflicts: # packages/stream_feeds/CHANGELOG.md
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @packages/stream_feeds/lib/src/models/model_updates.dart:
- Around line 35-78: The applyTo implementation in ModelUpdatesExtension
currently calls undefined extensions batchReplace and merge; replace those calls
by explicitly performing the update/merge logic inside applyTo: build a
Map<String,T> from the incoming list using the provided key, iterate updated and
set map[key(updatedItem)] = updatedItem, iterate added and only insert if map
does not contain the key, remove entries whose keys are in removedIds, then
produce the result list from map.values and apply compare if provided; update
the body of ModelUpdatesExtension.applyTo to remove batchReplace/merge/whereNot
usage and implement this map-based replace/merge/remove logic instead.
🧹 Nitpick comments (1)
packages/stream_feeds/CHANGELOG.md (1)
6-6: Consider varying sentence structure for better readability.Three consecutive bullet points start with "Add". While this is grammatically correct, varying the sentence structure could improve readability.
✍️ Optional refactor suggestion
-- Add batch follow and unfollow support. +- Batch follow and unfollow operations are now supported.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (19)
packages/stream_feeds/CHANGELOG.mdpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/test/client/feeds_client_test.dartpackages/stream_feeds_test/lib/src/helpers/test_data.dart
🧰 Additional context used
📓 Path-based instructions (8)
**/*.dart
📄 CodeRabbit inference engine (.cursor/rules/cursor-rules-location.mdc)
**/*.dart: Use the barrel_files package with @includeInBarrelFile annotations for public API management in Dart projects; keep implementation details in lib/src/ without annotations
Mark only classes, functions, and enums intended for external package usage with @includeInBarrelFile; keep repository classes, mappers, and internal state objects in lib/src/ without annotations
**/*.dart: Use@freezedmixed mode for data classes in Dart
ReturnResult<T>from all repository methods in Dart
Apply early return patterns consistently in Dart code
Use pattern matching withswitchexpressions in Dart
Mark public APIs with@includeInBarrelFileannotation in Dart
Follow enhanced enum vs sealed class guidelines in Dart
Use const constructors where possible in Dart
Implement proper disposal patterns in Dart StateNotifiers and providers
Ensure pure Dart compatibility across VM, Flutter, and Web environments
Plan for StateNotifier reactive patterns when implementing state management in Dart
**/*.dart: Use @freezed for all data classes with required id fields and const constructors
Implement StateNotifier-based reactive state management with automatic change notifications
Apply Result pattern for all async operations with explicit error handling
Use early return patterns for clean control flow in Dart code
Create extension functions for data mapping using.toModel()pattern instead of mapper classes
Mark public APIs with @includeInBarrelFile annotation for barrel file export management
Implement proper resource management with disposal and cleanup patterns in Dart code
Use constructor injection for all dependencies in Dart classes
**/*.dart: All data models should use @freezed with Dart's mixed mode syntax and include @OverRide annotations on fields
Mark classes for public export using @includeInBarrelFile annotation
Use extension functions with.toModel()convention for data mapping instead of dedicated mapper classes
All repository methods must return Result...
Files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/test/client/feeds_client_test.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
packages/stream_feeds/lib/src/models/**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
packages/stream_feeds/lib/src/models/**/*.dart: Use@freezedfor all data classes in the Stream Feeds SDK
Follow Freezed 3.0 mixed mode syntax with@overrideannotations for fields
All models should have anidfield when representing entities
Place custom data fields last in constructors and class definitions
Model naming convention: Use*Datasuffix for model classes (e.g.,ActivityData,FeedData)
Query naming convention: Use*Querysuffix for query classes (e.g.,ActivitiesQuery,FeedsQuery)
Request naming convention: Use*Requestsuffix for request classes (e.g.,FeedAddActivityRequest)
Files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dart
packages/stream_feeds/lib/src/**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
Use
//for internal/private code documentation
Files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
packages/stream_feeds/lib/**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
Apply Dart analyzer configuration from
analysis_options.yamlfor code quality
Files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
packages/stream_feeds/lib/src/state/**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
packages/stream_feeds/lib/src/state/**/*.dart: State classes must use@freezedwith const constructors
State class naming convention: Use*Statesuffix for state classes (e.g.,FeedState,ActivityListState)
Files:
packages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
{**/api/**/*.dart,**/*_api.dart,**/client/*.dart}
📄 CodeRabbit inference engine (.cursor/rules/stream-feeds-api.mdc)
{**/api/**/*.dart,**/*_api.dart,**/client/*.dart}: Stream Feeds API integration should be implemented according to the Activity Streams specification with structured actor, verb, object, and target fields
Implement proper authentication using API keys and user tokens via the StreamFeedsClient with tokenProvider parameter
Implement structured error handling for Stream Feeds API responses including 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests, and 500 Internal Server Error status codes
Use batch operations for bulk activity creation and updates to optimize API performance
Implement WebSocket event handlers for real-time Stream Feeds updates including activity events, reaction events, follow events, and member events
Respect API rate limiting by implementing retry logic with retry-after headers and designing applications to handle rate limit responses gracefully
Implement circuit breaker pattern for automatic failure recovery in Stream Feeds API interactions
Use connection pooling and gzip compression for efficient HTTP connection management and reduced bandwidth when communicating with Stream Feeds API
Files:
packages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/test/client/feeds_client_test.dart
packages/stream_feeds/test/**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
packages/stream_feeds/test/**/*.dart: Test through public APIs only, not internal StateNotifier implementations
Use HTTP interceptors instead of mocking repositories in tests
Mirror thelib/structure intest/directory organization
Files:
packages/stream_feeds/test/client/feeds_client_test.dart
packages/stream_feeds/lib/src/repository/**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
packages/stream_feeds/lib/src/repository/**/*.dart: All repository methods must returnResult<T>types for explicit error handling
Use early return patterns for validation and errors in repository methods
Use extension functions for API-to-domain model mapping in repositories
Never throw exceptions in repositories - always return Result types
Files:
packages/stream_feeds/lib/src/repository/feeds_repository.dart
🧠 Learnings (48)
📓 Common learnings
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Use batch operations for bulk activity creation and updates to optimize API performance
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/stream_feeds.dart : Follow Effective Dart documentation guidelines for all public APIs
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Stream Feeds API integration should be implemented according to the Activity Streams specification with structured actor, verb, object, and target fields
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Implement circuit breaker pattern for automatic failure recovery in Stream Feeds API interactions
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Implement WebSocket event handlers for real-time Stream Feeds updates including activity events, reaction events, follow events, and member events
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Plan for growth with efficient pagination and connection management when designing Stream Feeds integration for scalability
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/stream_feeds.dart : Follow Effective Dart documentation guidelines for all public APIs
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/CHANGELOG.mdpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/test/client/feeds_client_test.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/models/**/*.dart : Follow Freezed 3.0 mixed mode syntax with `override` annotations for fields
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/models/**/*.dart : Request naming convention: Use `*Request` suffix for request classes (e.g., `FeedAddActivityRequest`)
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/stream_feeds.dart : Keep public API minimal - most code should be in `lib/src/` internal directory
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/test/client/feeds_client_test.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/models/**/*.dart : Use `freezed` for all data classes in the Stream Feeds SDK
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/models/**/*.dart : Model naming convention: Use `*Data` suffix for model classes (e.g., `ActivityData`, `FeedData`)
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/stream_feeds.dart : Use `///` for public API documentation in exported classes and methods
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/CHANGELOG.mdpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/generated/**/*.dart : Never manually edit generated files (`*.freezed.dart`, `*.g.dart`, `src/generated/`)
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:37:17.519Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Stream Feeds API integration should be implemented according to the Activity Streams specification with structured actor, verb, object, and target fields
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/test/client/feeds_client_test.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/stream_feeds.dart : Export public API classes from main library entry point `lib/stream_feeds.dart`
Applied to files:
packages/stream_feeds/lib/src/models/follow_data.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:37:37.953Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-sdk.mdc:0-0
Timestamp: 2025-12-05T14:37:37.953Z
Learning: Applies to **/*.dart : Use immutable freezed models for all data classes with required id fields
Applied to files:
packages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/models/**/*.dart : All models should have an `id` field when representing entities
Applied to files:
packages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
📚 Learning: 2025-12-05T14:37:05.876Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-12-05T14:37:05.876Z
Learning: Applies to **/*.dart : Use freezed for all data classes with required id fields and const constructors
Applied to files:
packages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:37:37.953Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-sdk.mdc:0-0
Timestamp: 2025-12-05T14:37:37.953Z
Learning: Applies to **/*.dart : Compose complex states from simpler freezed components using copyWith for immutable updates
Applied to files:
packages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/state/**/*.dart : State classes must use `freezed` with const constructors
Applied to files:
packages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:37:37.953Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-sdk.mdc:0-0
Timestamp: 2025-12-05T14:37:37.953Z
Learning: Applies to **/*.dart : All data models should use freezed with Dart's mixed mode syntax and include override annotations on fields
Applied to files:
packages/stream_feeds/lib/src/models/model_updates.freezed.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:37:17.519Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Use batch operations for bulk activity creation and updates to optimize API performance
Applied to files:
packages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/test/client/feeds_client_test.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/stream_feeds.dart : Include examples for complex APIs in documentation
Applied to files:
packages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/test/client/feeds_client_test.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/test/**/*.dart : Use HTTP interceptors instead of mocking repositories in tests
Applied to files:
packages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/test/client/feeds_client_test.dart
📚 Learning: 2025-12-05T14:37:17.519Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Implement circuit breaker pattern for automatic failure recovery in Stream Feeds API interactions
Applied to files:
packages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/test/client/feeds_client_test.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/repository/**/*.dart : Use extension functions for API-to-domain model mapping in repositories
Applied to files:
packages/stream_feeds_test/lib/src/helpers/test_data.dartpackages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/state/**/*.dart : State class naming convention: Use `*State` suffix for state classes (e.g., `FeedState`, `ActivityListState`)
Applied to files:
packages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/state/follow_list_state.dart
📚 Learning: 2025-12-05T14:37:17.519Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Implement WebSocket event handlers for real-time Stream Feeds updates including activity events, reaction events, follow events, and member events
Applied to files:
packages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/test/client/feeds_client_test.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/state/**/*StateNotifier.dart : Use StateNotifier for reactive state management
Applied to files:
packages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/state/follow_list_state.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/state/**/*StateNotifier.dart : StateNotifier naming convention: Use `*StateNotifier` suffix for StateNotifier implementations (e.g., `FeedStateNotifier`)
Applied to files:
packages/stream_feeds/lib/src/state/event/state_update_event.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/follow_list_state.dart
📚 Learning: 2025-12-16T23:49:28.671Z
Learnt from: xsahil03x
Repo: GetStream/stream-feeds-flutter PR: 71
File: packages/stream_feeds/lib/src/state/event/handler/bookmark_folder_list_event_handler.dart:23-40
Timestamp: 2025-12-16T23:49:28.671Z
Learning: In the Stream Feeds Flutter SDK, `BookmarkFolderAddedEvent` does not exist in the backend and SDK. Only `BookmarkFolderUpdatedEvent` and `BookmarkFolderDeletedEvent` are available for bookmark folder event handling.
Applied to files:
packages/stream_feeds/lib/src/state/event/state_update_event.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/generated/**/*.dart : Never manually edit OpenAPI-generated API code files in `src/generated/`
Applied to files:
packages/stream_feeds/lib/src/models.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/models/**/*.dart : Query naming convention: Use `*Query` suffix for query classes (e.g., `ActivitiesQuery`, `FeedsQuery`)
Applied to files:
packages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/lib/src/state/follow_list_state.dartpackages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:37:37.953Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-sdk.mdc:0-0
Timestamp: 2025-12-05T14:37:37.953Z
Learning: Applies to **/*.dart : Define separate query specifications from data models using freezed classes
Applied to files:
packages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/follow_list_state.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/models/**/*.dart : Place custom data fields last in constructors and class definitions
Applied to files:
packages/stream_feeds/lib/src/models.dartpackages/stream_feeds/lib/src/models/batch_follow_data.dart
📚 Learning: 2025-12-05T14:37:05.876Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-12-05T14:37:05.876Z
Learning: Applies to **/*.dart : Create extension functions for data mapping using `.toModel()` pattern instead of mapper classes
Applied to files:
packages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:36:55.335Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/planit-mode.mdc:0-0
Timestamp: 2025-12-05T14:36:55.335Z
Learning: Applies to **/*.dart : Use `freezed` mixed mode for data classes in Dart
Applied to files:
packages/stream_feeds/lib/src/models/batch_follow_data.dartpackages/stream_feeds/lib/src/models/batch_follow_data.freezed.dartpackages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:37:37.953Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-sdk.mdc:0-0
Timestamp: 2025-12-05T14:37:37.953Z
Learning: Applies to **/*.dart : Use Dart's type-safe queries for API operations with freezed query specifications
Applied to files:
packages/stream_feeds/lib/src/models/batch_follow_data.dart
📚 Learning: 2025-12-05T14:37:17.519Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Implement proper authentication using API keys and user tokens via the StreamFeedsClient with tokenProvider parameter
Applied to files:
packages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/feeds_client.dart
📚 Learning: 2025-12-05T14:37:17.519Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Implement structured error handling for Stream Feeds API responses including 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 429 Too Many Requests, and 500 Internal Server Error status codes
Applied to files:
packages/stream_feeds/lib/src/client/feeds_client_impl.dartpackages/stream_feeds/lib/src/feeds_client.dartpackages/stream_feeds/test/client/feeds_client_test.dart
📚 Learning: 2025-12-05T14:37:17.519Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-api.mdc:0-0
Timestamp: 2025-12-05T14:37:17.519Z
Learning: Applies to {**/api/**/*.dart,**/*_api.dart,**/client/*.dart} : Use connection pooling and gzip compression for efficient HTTP connection management and reduced bandwidth when communicating with Stream Feeds API
Applied to files:
packages/stream_feeds/lib/src/client/feeds_client_impl.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/test/**/*.dart : Test through public APIs only, not internal StateNotifier implementations
Applied to files:
packages/stream_feeds/lib/src/state/feed_state.dartpackages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/test/client/feeds_client_test.dart
📚 Learning: 2025-12-05T14:37:05.876Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/project-overview.mdc:0-0
Timestamp: 2025-12-05T14:37:05.876Z
Learning: Applies to **/*.dart : Implement StateNotifier-based reactive state management with automatic change notifications
Applied to files:
packages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/follow_list_state.dart
📚 Learning: 2025-12-05T14:37:37.953Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-sdk.mdc:0-0
Timestamp: 2025-12-05T14:37:37.953Z
Learning: Applies to **/*.dart : Use StateNotifier for reactive state management with automatic change notifications
Applied to files:
packages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/follow_list_state.dart
📚 Learning: 2025-12-05T14:37:37.953Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-sdk.mdc:0-0
Timestamp: 2025-12-05T14:37:37.953Z
Learning: Implement reactive state management with StateNotifier-based state management and automatic notifications
Applied to files:
packages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/follow_list_state.dart
📚 Learning: 2025-12-05T14:36:55.335Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/planit-mode.mdc:0-0
Timestamp: 2025-12-05T14:36:55.335Z
Learning: Applies to **/*.dart : Plan for StateNotifier reactive patterns when implementing state management in Dart
Applied to files:
packages/stream_feeds/lib/src/state/member_list_state.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/ws/events/**/*.dart : Real-time event handlers must use `freezed` for type-safe event handling in WebSocket layer
Applied to files:
packages/stream_feeds/lib/src/state/member_list_state.dartpackages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/models/model_updates.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
📚 Learning: 2025-12-16T23:49:25.329Z
Learnt from: xsahil03x
Repo: GetStream/stream-feeds-flutter PR: 71
File: packages/stream_feeds/lib/src/state/event/handler/bookmark_folder_list_event_handler.dart:23-40
Timestamp: 2025-12-16T23:49:25.329Z
Learning: In the Flutter Stream Feeds SDK, BookmarkFolderAddedEvent does not exist in either backend or SDK. Review all event handling in the bookmark_folder_list_event_handler.dart (and related handler files) to rely only on BookmarkFolderUpdatedEvent and BookmarkFolderDeletedEvent. Remove any references to BookmarkFolderAddedEvent, adjust parsing/dispatch logic accordingly, and update tests and documentation to reflect supported events.
Applied to files:
packages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dartpackages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dartpackages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart
📚 Learning: 2025-12-05T14:37:37.953Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: .cursor/rules/stream-feeds-sdk.mdc:0-0
Timestamp: 2025-12-05T14:37:37.953Z
Learning: Applies to **/*.dart : Use extension functions with `.toModel()` convention for data mapping instead of dedicated mapper classes
Applied to files:
packages/stream_feeds/lib/src/models/model_updates.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Implement reactive state management with automatic change notifications using StateNotifier
Applied to files:
packages/stream_feeds/lib/src/state/follow_list_state.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/repository/**/*.dart : All repository methods must return `Result<T>` types for explicit error handling
Applied to files:
packages/stream_feeds/lib/src/repository/feeds_repository.dart
📚 Learning: 2025-12-05T14:38:02.662Z
Learnt from: CR
Repo: GetStream/stream-feeds-flutter PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:38:02.662Z
Learning: Applies to packages/stream_feeds/lib/src/repository/**/*.dart : Use early return patterns for validation and errors in repository methods
Applied to files:
packages/stream_feeds/lib/src/repository/feeds_repository.dart
🪛 LanguageTool
packages/stream_feeds/CHANGELOG.md
[style] ~6-~6: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ent user is following from this feed. - Add batch follow and unfollow support. ## ...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: stream_feeds
- GitHub Check: analyze
- GitHub Check: build
🔇 Additional comments (23)
packages/stream_feeds/lib/src/models.dart (1)
5-5: LGTM! Public exports correctly added.The new exports for
batch_follow_data.dartandmodel_updates.dartare properly positioned alphabetically and follow the existing export pattern in this barrel file.Also applies to: 19-19
packages/stream_feeds_test/lib/src/helpers/test_data.dart (2)
717-726: LGTM! Test helper follows existing patterns.The
createDefaultFollowBatchResponsefunction is well-structured and consistent with other test helpers in this file, providing sensible defaults for batch follow response testing.
728-735: LGTM! Test helper follows existing patterns.The
createDefaultUnfollowBatchResponsefunction is well-structured and consistent with other test helpers in this file, providing sensible defaults for batch unfollow response testing.packages/stream_feeds/lib/src/models/batch_follow_data.freezed.dart (1)
1-88: Generated Freezed code - no manual review required.This is a Freezed-generated file that should not be manually edited. The generated code follows the expected Freezed pattern for the
BatchFollowDatamodel.packages/stream_feeds/lib/src/state/event/handler/feed_event_handler.dart (1)
174-176: LGTM! Batch update handler correctly implemented.The
FollowBatchUpdateevent handler follows the established pattern in this file and correctly delegates tostate.onFollowsUpdated()for processing batch follow updates.packages/stream_feeds/lib/src/models/model_updates.freezed.dart (1)
1-95: Skip review: Generated file.This is a Freezed-generated file that should not be manually edited. The changes here correctly reflect the
removedIdstype change fromList<String>toSet<String>in the sourcemodel_updates.dartfile.packages/stream_feeds/lib/src/models/follow_data.dart (1)
103-110: LGTM!The new
isFollowRequestFormethod correctly complements the existingisFollowerOfandisFollowingFeedmethods. The logic properly checks for pending status combined with target feed ID matching, and the documentation follows Effective Dart guidelines.packages/stream_feeds/lib/src/state/event/handler/member_list_event_handler.dart (1)
57-61: LGTM!The change from list spread
[...]to set literal{...}correctly aligns with theModelUpdates.removedIdstype change fromList<String>toSet<String>. Using a Set ensures automatic deduplication when mergingevent.updates.removedIdswith IDs from items that no longer match the filter.packages/stream_feeds/lib/src/state/event/handler/follow_list_event_handler.dart (1)
46-60: LGTM!The
FollowBatchUpdatehandler correctly mirrors the pattern established inMemberListEventHandler:
- Filters
addeditems by the query filter- Partitions
updateditems into matching and non-matching groups- Combines explicit
removedIdswith IDs of items that no longer match the filter- Uses a Set for automatic deduplication
This properly integrates batch follow/unfollow operations with the existing event handling architecture.
packages/stream_feeds/lib/src/state/member_list_state.dart (1)
79-86: LGTM!The refactoring to use
updates.applyTo()consolidates the batch update logic into a single, reusable utility. This follows the DRY principle and maintains consistency with the API used throughout the codebase for applying model updates.packages/stream_feeds/lib/src/state/event/state_update_event.dart (1)
739-745: LGTM!The
FollowBatchUpdateclass correctly follows the established pattern for batch update events (matchingFeedMemberBatchUpdate). The class is properly documented and placed in the Follow Events region. It appropriately lacks afromWsEventmapping since batch operations originate from API calls rather than WebSocket events.packages/stream_feeds/lib/src/state/follow_list_state.dart (1)
77-87: LGTM!The
onFollowsUpdatedmethod correctly implements batch update handling for the follow list, mirroring the pattern established inMemberListStateNotifier.onMembersUpdated. It properly usesupdates.applyTo()with the ID extraction key and sorting comparator to maintain list consistency.packages/stream_feeds/test/client/feeds_client_test.dart (1)
522-724: LGTM! Comprehensive test coverage for batch follow operations.The test implementation follows best practices:
- Tests through public APIs as per guidelines
- Covers success paths with mixed results (created + existing follows)
- Covers failure paths with proper error handling
- Verifies state update event emission
- Uses consistent patterns with existing tests
packages/stream_feeds/lib/src/feeds_client.dart (1)
784-853: LGTM! Well-designed batch follow API.The new methods follow best practices:
- Comprehensive documentation with clear examples
- Uses
Result<T>for explicit error handling- Leverages batch operations for performance optimization (as per learnings)
- Clear distinction between created and all follows in return types
- Consistent with existing API patterns
Based on learnings, batch operations optimize API performance for bulk operations.
packages/stream_feeds/lib/src/models/batch_follow_data.dart (1)
1-46: LGTM! Properly structured model and mapper.The implementation follows coding guidelines:
- Uses
@freezedwith mixed mode syntax correctly- Model uses
*Datasuffix convention (BatchFollowData)- Fields marked with
@overrideannotations as per Freezed 3.0- Extension uses
.toModel()pattern for mapping as per guidelines- Clear documentation distinguishing
createdvsfollowslistsAs per coding guidelines, extension functions are used for data mapping instead of mapper classes.
packages/stream_feeds/lib/src/state/feed_state.dart (1)
348-384: LGTM! Well-structured batch follow update handler.The implementation correctly handles batch follow updates:
- Properly classifies follows into followers, following, and follow requests
- Maintains follow request lifecycle (accepted followers removed from requests at line 365)
- Uses immutable state updates with
copyWith- Applies
ModelUpdates.applyToextension for list merging- Follows StateNotifier patterns as per guidelines
The logic at lines 363-365 is particularly well-thought-out: newly accepted followers are automatically removed from follow requests, maintaining state consistency.
packages/stream_feeds/lib/src/repository/feeds_repository.dart (3)
67-68: Improved follow request filtering.The change from
isFollowRequesttoisFollowRequestFor(fid)makes the filtering more explicit and feed-specific, improving clarity and correctness.
234-262: LGTM! Clean batch follow repository methods.The implementation follows repository best practices:
- Returns
Result<T>types for explicit error handling as per guidelines- Uses extension functions (
.toModel()) for API-to-domain mapping as per guidelines- Proper documentation with clear descriptions
- Delegates to API layer appropriately
getOrCreateFollowsreturnsBatchFollowDatawith both created and all followsgetOrCreateUnfollowsreturns list of unfollowed feedsBased on learnings, batch operations optimize API performance for bulk relationship management.
316-316: Good use of Set for unique IDs.Converting
removedIdstoSet<String>ensures uniqueness and provides O(1) lookups, which is semantically correct for ID collections.packages/stream_feeds/lib/src/client/feeds_client_impl.dart (3)
12-16: LGTM!Imports are correctly added for the new batch follow/unfollow functionality.
508-525: LGTM! Clean batch follow implementation.The logic correctly separates newly created follows from already-existing ones by using a
Setfor O(1) lookup, then emits the appropriate state update event. This aligns well with the batch operations pattern from the learnings.
527-542: LGTM! Batch unfollow implementation is consistent.The method correctly builds
ModelUpdateswithremovedIdsand emits the state update event. The pattern mirrorsgetOrCreateFollowsfor consistency.packages/stream_feeds/lib/src/models/model_updates.dart (1)
15-19: Good use ofSetforremovedIds.Using
Set<String>instead ofList<String>is semantically correct for unique identifiers and provides O(1) lookup performance in theapplyTomethod'swhereNotoperation. This is a worthwhile breaking change.
Description of the pull request
getOrCreateFollowsandgetOrCreateUnfollowstoFeedsClient.FeedsClientImplandFeedsRepository.FollowBatchUpdatestate update event to handle batch operations.ModelUpdateswith anapplyToextension for easier list state manipulation.FeedState,FollowListState, andMemberListStateto handle batch updates.ModelUpdates.removedIdsfromListtoSetfor better performance.feeds_client_test.dart.Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.