-
Notifications
You must be signed in to change notification settings - Fork 1
feat(llc): add updateActivityPartial method to Feed class #87
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
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 📝 WalkthroughWalkthroughAdds a new partial activity update flow: Changes
Sequence Diagram(s)sequenceDiagram
actor Client
participant Feed
participant ActivitiesRepository as Repo
participant API
participant StateChannel as Channel
Client->>Feed: updateActivityPartial(id, request)
Feed->>Repo: updateActivityPartial(id, request)
Repo->>API: updateActivityPartial(id, request)
API-->>Repo: updated activity response
Repo-->>Feed: Result<ActivityData>
Feed->>Channel: emit ActivityUpdated(activity)
Feed-->>Client: Result<ActivityData>
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Co-authored-by: xsahil03x <25670178+xsahil03x@users.noreply.github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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/state/feed.dart:
- Around line 229-269: The doc comments for updateActivityPartial reference
UpdateActivityPartialRequest.set and .unset which are out of scope; update the
references to the fully-qualified generated type
(api.UpdateActivityPartialRequest.set and
api.UpdateActivityPartialRequest.unset) or rephrase the sentence to avoid inline
member links (e.g., "use the request's set map" and "use the request's unset
list"), keeping the rest of the existing /// doc for the public method
updateActivityPartial intact.
📜 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 (4)
docs/code_snippets/03_01_activities.dartpackages/stream_feeds/lib/src/repository/activities_repository.dartpackages/stream_feeds/lib/src/state/feed.dartpackages/stream_feeds/test/state/feed_test.dart
🧰 Additional context used
📓 Path-based instructions (6)
**/*.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/repository/activities_repository.dartdocs/code_snippets/03_01_activities.dartpackages/stream_feeds/test/state/feed_test.dartpackages/stream_feeds/lib/src/state/feed.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/activities_repository.dart
packages/stream_feeds/lib/src/**/*.dart
📄 CodeRabbit inference engine (AGENTS.md)
Use
//for internal/private code documentation
Files:
packages/stream_feeds/lib/src/repository/activities_repository.dartpackages/stream_feeds/lib/src/state/feed.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/repository/activities_repository.dartpackages/stream_feeds/lib/src/state/feed.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/state/feed_test.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/feed.dart
🧠 Learnings (17)
📓 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} : Stream Feeds API integration should be implemented according to the Activity Streams specification with structured actor, verb, object, and target fields
📚 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/repository/activities_repository.dartdocs/code_snippets/03_01_activities.dartpackages/stream_feeds/test/state/feed_test.dartpackages/stream_feeds/lib/src/state/feed.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/lib/src/repository/activities_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 : All repository methods must return `Result<T>` types for explicit error handling
Applied to files:
packages/stream_feeds/lib/src/repository/activities_repository.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/lib/src/repository/activities_repository.dartdocs/code_snippets/03_01_activities.dartpackages/stream_feeds/lib/src/state/feed.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/repository/activities_repository.dartdocs/code_snippets/03_01_activities.dartpackages/stream_feeds/test/state/feed_test.dartpackages/stream_feeds/lib/src/state/feed.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 : Never throw exceptions in repositories - always return Result types
Applied to files:
packages/stream_feeds/lib/src/repository/activities_repository.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:
docs/code_snippets/03_01_activities.dartpackages/stream_feeds/test/state/feed_test.dartpackages/stream_feeds/lib/src/state/feed.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:
docs/code_snippets/03_01_activities.dartpackages/stream_feeds/test/state/feed_test.dartpackages/stream_feeds/lib/src/state/feed.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/test/state/feed_test.dartpackages/stream_feeds/lib/src/state/feed.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/test/state/feed_test.dartpackages/stream_feeds/lib/src/state/feed.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/state/feed_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/stream_feeds.dart : Include examples for complex APIs in documentation
Applied to files:
packages/stream_feeds/test/state/feed_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/stream_feeds.dart : Follow Effective Dart documentation guidelines for all public APIs
Applied to files:
packages/stream_feeds/test/state/feed_test.dartpackages/stream_feeds/lib/src/state/feed.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/test/state/feed_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/stream_feeds.dart : Use `///` for public API documentation in exported classes and methods
Applied to files:
packages/stream_feeds/lib/src/state/feed.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/state/feed.dart
🪛 GitHub Actions: stream_feed_flutter_workflow
packages/stream_feeds/lib/src/state/feed.dart
[warning] 237-238: The referenced name isn't visible in scope. Try adding an import for the referenced name. - comment_references
[warning] 237-238: The referenced name isn't visible in scope. Try adding an import for the referenced name. - comment_references
🔇 Additional comments (3)
packages/stream_feeds/test/state/feed_test.dart (1)
289-344: LGTM! Test follows established patterns.The test properly validates the partial update flow: API mocking, method invocation, result verification, and event emission. The structure mirrors existing activity tests and provides adequate coverage.
packages/stream_feeds/lib/src/repository/activities_repository.dart (1)
92-113: LGTM! Repository method correctly implements partial update.The implementation follows the established repository pattern: delegates to the API client, maps the response to domain model using
.toModel(), and returns aResult<ActivityData>. Documentation clearly explains the method's purpose and parameters.Based on learnings, all repository methods return
Result<T>types for explicit error handling.docs/code_snippets/03_01_activities.dart (1)
92-99: LGTM! Clear documentation example.The code snippet effectively demonstrates the partial update feature, showing both
set(to update/add fields) andunset(to remove fields) capabilities. The inline comment clarifies the purpose of theunsetparameter.
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
This PR adds the previously documented but missing updateActivityPartial method to the Stream Feeds Flutter SDK. The method allows efficient partial updates of activity fields without requiring fetching and resending the entire activity object.
Key Changes:
- Added
updateActivityPartialmethod to theActivitiesRepositoryandFeedclasses - Added comprehensive test coverage following existing patterns
- Added documentation example showing usage with
setandunsetoperations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/stream_feeds/lib/src/repository/activities_repository.dart | Added updateActivityPartial method that wraps the generated API endpoint |
| packages/stream_feeds/lib/src/state/feed.dart | Added updateActivityPartial method with comprehensive documentation and event emission |
| packages/stream_feeds/test/state/feed_test.dart | Added test case verifying partial update functionality and event emission |
| docs/code_snippets/03_01_activities.dart | Added documentation example demonstrating partial update usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot ci checks are failing |
Co-authored-by: xsahil03x <25670178+xsahil03x@users.noreply.github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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: 0
🧹 Nitpick comments (1)
packages/stream_feeds/CHANGELOG.md (1)
2-2: Standardize verb tense in the Upcoming section.Line 2 uses "Added" (past tense) while line 7 and the surrounding entries use "Add" (present tense). For consistency across the changelog, align all entries in the Upcoming section to use the same tense.
Suggested fix
- Added missing state updates for the websocket events. + Add missing state updates for the websocket events.Also applies to: 7-7
📜 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 (4)
docs/code_snippets/03_01_activities.dartpackages/stream_feeds/CHANGELOG.mdpackages/stream_feeds/lib/src/state/feed.dartpackages/stream_feeds/test/state/feed_test.dart
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/stream_feeds/test/state/feed_test.dart
- packages/stream_feeds/lib/src/state/feed.dart
- docs/code_snippets/03_01_activities.dart
🧰 Additional context used
🧠 Learnings (5)
📓 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} : Stream Feeds API integration should be implemented according to the Activity Streams specification with structured actor, verb, object, and target fields
📚 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/CHANGELOG.md
📚 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/CHANGELOG.md
📚 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/CHANGELOG.md
📚 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/CHANGELOG.md
🪛 LanguageTool
packages/stream_feeds/CHANGELOG.md
[style] ~7-~7: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...dd batch follow and unfollow support. - Add updateActivityPartial method to `Feed...
(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). (1)
- GitHub Check: build
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
==========================================
+ Coverage 85.83% 85.86% +0.02%
==========================================
Files 124 124
Lines 4292 4300 +8
==========================================
+ Hits 3684 3692 +8
Misses 608 608 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Submit a pull request
CLA
Description of the pull request
The SDK was missing
updateActivityPartial()despite being documented. Users had to fetch the entire activity, merge fields manually, and send the complete object back—inefficient for single-field updates.Changes:
updateActivityPartialtoActivitiesRepositorywrapping the existing generated API endpointupdateActivityPartialtoFeedclass with documentation and event emissiondocs/code_snippets/03_01_activities.dartUsage:
Screenshots / Videos
Original prompt
updateActivityPartialmethod - documented but missing in SDK #82💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Summary by CodeRabbit
New Features
Tests
Changelog
✏️ Tip: You can customize this high-level summary in your review settings.