Skip to content

Conversation

@xsahil03x
Copy link
Member

@xsahil03x xsahil03x commented Jan 8, 2026

Submit a pull request

Closes #81

Description of the pull request

This PR introduces support for the Collections API, allowing for the management of reusable data objects that can be attached to activities.

  • Adds CollectionsRepository to handle create, read, update, and delete (CRUD) operations for collections.
  • Integrates CollectionsRepository into FeedsClientImpl and exposes the new collection methods in the FeedsClient interface.
  • Introduces CollectionData model and maps it from the API response.
  • Adds collectionRefs to FeedAddActivityRequest to allow attaching collections when creating an activity.
  • Updates ActivityData to include enriched collections.
  • Adds tests for all new collection-related functionalities.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a complete collections management API enabling batch read, create, update, and delete operations on collections.
    • Activities now support attaching collection references and storing enriched collection data.
    • Collections data includes status information, creation and update timestamps, user attribution, and custom metadata support.

✏️ Tip: You can customize this high-level summary in your review settings.

This commit introduces support for the Collections API, allowing for the management of reusable data objects that can be attached to activities.

- Adds `CollectionsRepository` to handle create, read, update, and delete (CRUD) operations for collections.
- Integrates `CollectionsRepository` into `FeedsClientImpl` and exposes the new collection methods in the `FeedsClient` interface.
- Introduces `CollectionData` model and maps it from the API response.
- Adds `collectionRefs` to `FeedAddActivityRequest` to allow attaching collections when creating an activity.
- Updates `ActivityData` to include enriched `collections`.
- Adds tests for all new collection-related functionalities.
@xsahil03x xsahil03x requested a review from a team as a code owner January 8, 2026 17:46
@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

This PR adds collections API support to the Stream Feeds SDK, introducing a new CollectionsRepository with CRUD methods (read, create, update, delete), a CollectionData domain model with status tracking, and extends ActivityData and FeedAddActivityRequest to expose and attach collections respectively.

Changes

Cohort / File(s) Summary
Collections Domain Model
packages/stream_feeds/lib/src/models/collection_data.dart, collection_data.freezed.dart
New domain model for collections with id, name, status, createdAt, updatedAt, userId, and custom fields. Includes Freezed codegen, CollectionStatus extension type (ok, notfound, unknown), and mappers (EnrichedCollectionResponseMapper, EnrichedCollectionResponseStatusMapper) to convert API responses to domain models.
Activity Model Extensions
packages/stream_feeds/lib/src/models/activity_data.dart, activity_data.freezed.dart
Added collections: Map<String, CollectionData> field to ActivityData with constructor parameter and mapping logic in ActivityResponseMapper.toModel(). Updated Freezed codegen for equality, hashCode, toString, and copyWith support.
Request Model Extensions
packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart, feed_add_activity_request.freezed.dart
Added optional collectionRefs: List<String>? field to FeedAddActivityRequest with documentation and mapping in FeedAddActivityRequestMapper.toRequest(). Updated Freezed codegen accordingly.
Collections Repository & Client Integration
packages/stream_feeds/lib/src/repository/collections_repository.dart, packages/stream_feeds/lib/src/client/feeds_client_impl.dart
New CollectionsRepository with four public methods (readCollections, createCollections, updateCollections, deleteCollections) that delegate to api.DefaultApi. StreamFeedsClientImpl integrates repository with corresponding delegating methods.
Public API Surface
packages/stream_feeds/lib/src/feeds_client.dart, packages/stream_feeds/lib/src/models.dart, CHANGELOG.md
Added four collection operations to StreamFeedsClient interface with documentation. Exported CollectionData from models.dart. Updated CHANGELOG with new methods and data structures.
Test Support
packages/stream_feeds/test/client/feeds_client_test.dart, packages/stream_feeds_test/lib/src/helpers/test_data.dart
Added comprehensive test coverage for all collection operations (read, create, update, delete) with success and failure paths. Extended test data helpers with CollectionResponse, EnrichedCollectionResponse, and all *CollectionsResponse constructors. Updated createDefaultActivityResponse to support collections parameter.
Cleanup
packages/stream_feeds/lib/src/models/reaction_group_data.dart
Removed unused ReactionGroupDataMutations extension on ReactionGroupData (isEmpty getter, increment/decrement methods) and related imports.

Sequence Diagram

sequenceDiagram
    actor Client as Client App
    participant FCLI as StreamFeedsClientImpl
    participant CR as CollectionsRepository
    participant API as api.DefaultApi
    participant Result as Result<T>

    Note over Client,Result: Read Collections
    Client->>FCLI: readCollections(refs)
    FCLI->>CR: readCollections(refs)
    CR->>API: readCollections(refs)
    API-->>CR: ReadCollectionsResponse
    CR-->>FCLI: Result<ReadCollectionsResponse>
    FCLI-->>Client: Result<ReadCollectionsResponse>

    Note over Client,Result: Create Collections
    Client->>FCLI: createCollections(request)
    FCLI->>CR: createCollections(request)
    CR->>API: createCollections(request)
    API-->>CR: CreateCollectionsResponse
    CR-->>FCLI: Result<CreateCollectionsResponse>
    FCLI-->>Client: Result<CreateCollectionsResponse>

    Note over Client,Result: Update Collections
    Client->>FCLI: updateCollections(request)
    FCLI->>CR: updateCollections(request)
    CR->>API: updateCollections(request)
    API-->>CR: UpdateCollectionsResponse
    CR-->>FCLI: Result<UpdateCollectionsResponse>
    FCLI-->>Client: Result<UpdateCollectionsResponse>

    Note over Client,Result: Delete Collections
    Client->>FCLI: deleteCollections(refs)
    FCLI->>CR: deleteCollections(refs)
    CR->>API: deleteCollections(refs)
    API-->>CR: DeleteCollectionsResponse
    CR-->>FCLI: Result<DeleteCollectionsResponse>
    FCLI-->>Client: Result<DeleteCollectionsResponse>
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

Possibly related PRs

Suggested reviewers

  • renefloor
  • Brazol

Poem

🐰 Collections now flow through the feeds so bright,
With CRUD operations crafted just right,
ActivityData embraces maps of new delight,
While repositories handle requests with might,
A fluffy addition makes the SDK complete! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive All changes are directly related to collections API support. One unrelated change is the removal of ReactionGroupDataMutations extension, which may warrant clarification. Clarify why the ReactionGroupDataMutations extension was removed as it appears unrelated to collections API scope.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(llc): add support for collections API' clearly describes the main feature addition, though 'llc' scope is unclear and should be 'feeds' for consistency.
Description check ✅ Passed The PR description adequately covers the main changes: Collections API support, repository integration, model additions, and test coverage. However, it lacks CLA checkbox confirmation and doesn't follow the exact template structure.
Linked Issues check ✅ Passed The PR fully addresses issue #81 by adding the collections field to ActivityData, mapping it from ActivityResponse, and enabling collection operations through the new Collections API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@xsahil03x xsahil03x changed the title feat(feeds): add support for collections API feat(llc): add support for collections API Jan 8, 2026
@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 58.33333% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.83%. Comparing base (4279d2e) to head (07a9b90).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/stream_feeds/lib/src/models/collection_data.dart 0.00% 14 Missing ⚠️
...ges/stream_feeds/lib/src/models/activity_data.dart 66.66% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (58.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      #86      +/-   ##
==========================================
- Coverage   85.92%   85.83%   -0.10%     
==========================================
  Files         122      124       +2     
  Lines        4263     4292      +29     
==========================================
+ Hits         3663     3684      +21     
- Misses        600      608       +8     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link

@coderabbitai coderabbitai bot left a 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 (2)
packages/stream_feeds/CHANGELOG.md (1)

7-9: Vary sentence structure to improve changelog readability.

All three consecutive entries begin with "Add," creating repetitive phrasing. Consider restructuring for better variety and flow.

📝 Suggested rewording
- Add collections API methods: `readCollections`, `createCollections`, `updateCollections`, and `deleteCollections`.
- Add `CollectionData` model and `collections` field to `ActivityData` for enriched collection data.
- Add `collectionRefs` field to `FeedAddActivityRequest` to attach collections to activities.
+ Add collections API methods: `readCollections`, `createCollections`, `updateCollections`, and `deleteCollections`.
+ Introduce `CollectionData` model and `collections` field to `ActivityData` for enriched collection data.
+ Support attaching collections to activities via `collectionRefs` field in `FeedAddActivityRequest`.
packages/stream_feeds/lib/src/repository/collections_repository.dart (1)

21-30: Consider mapping API responses to domain models.

The repository returns raw API response types (api.ReadCollectionsResponse). According to the coding guidelines, repositories should use extension functions to map API responses to domain models before returning them. This would better encapsulate the API layer and provide a cleaner interface for consumers.

Example pattern using extension functions

Create a domain response model and extension function:

// Domain model
class ReadCollectionsData {
  final Map<String, CollectionData> collections;
  // ... other fields
}

// Extension on API response
extension ReadCollectionsResponseMapper on api.ReadCollectionsResponse {
  ReadCollectionsData toModel() {
    return ReadCollectionsData(
      collections: {
        for (final entry in collections.entries)
          entry.key: entry.value.toModel(),
      },
    );
  }
}

// In repository
Future<Result<ReadCollectionsData>> readCollections({
  required List<String> refs,
}) async {
  final result = await _api.readCollections(collectionRefs: refs);
  return result.map((response) => response.toModel());
}

Based on learnings, repositories should use extension functions for API-to-domain model mapping.

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 4279d2e and 07a9b90.

📒 Files selected for processing (14)
  • packages/stream_feeds/CHANGELOG.md
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/feeds_client.dart
  • packages/stream_feeds/lib/src/models.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • packages/stream_feeds/lib/src/models/reaction_group_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds/test/client/feeds_client_test.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
💤 Files with no reviewable changes (1)
  • packages/stream_feeds/lib/src/models/reaction_group_data.dart
🧰 Additional context used
📓 Path-based instructions (7)
**/*.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 @freezed mixed mode for data classes in Dart
Return Result<T> from all repository methods in Dart
Apply early return patterns consistently in Dart code
Use pattern matching with switch expressions in Dart
Mark public APIs with @includeInBarrelFile annotation 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/test/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/models/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • packages/stream_feeds/lib/src/models.dart
  • packages/stream_feeds/lib/src/feeds_client.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/test/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.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 the lib/ structure in test/ directory organization

Files:

  • packages/stream_feeds/test/client/feeds_client_test.dart
packages/stream_feeds/lib/src/models/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

packages/stream_feeds/lib/src/models/**/*.dart: Use @freezed for all data classes in the Stream Feeds SDK
Follow Freezed 3.0 mixed mode syntax with @override annotations for fields
All models should have an id field when representing entities
Place custom data fields last in constructors and class definitions
Model naming convention: Use *Data suffix for model classes (e.g., ActivityData, FeedData)
Query naming convention: Use *Query suffix for query classes (e.g., ActivitiesQuery, FeedsQuery)
Request naming convention: Use *Request suffix for request classes (e.g., FeedAddActivityRequest)

Files:

  • packages/stream_feeds/lib/src/models/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.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/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • packages/stream_feeds/lib/src/models.dart
  • packages/stream_feeds/lib/src/feeds_client.dart
packages/stream_feeds/lib/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

Apply Dart analyzer configuration from analysis_options.yaml for code quality

Files:

  • packages/stream_feeds/lib/src/models/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • packages/stream_feeds/lib/src/models.dart
  • packages/stream_feeds/lib/src/feeds_client.dart
packages/stream_feeds/lib/src/repository/**/*.dart

📄 CodeRabbit inference engine (AGENTS.md)

packages/stream_feeds/lib/src/repository/**/*.dart: All repository methods must return Result<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/collections_repository.dart
🧠 Learnings (40)
📓 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
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
📚 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/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/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.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 : Mirror the `lib/` structure in `test/` directory organization

Applied to files:

  • packages/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/stream_feeds.dart : Include examples for complex APIs in documentation

Applied to files:

  • packages/stream_feeds/test/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/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 circuit breaker pattern for automatic failure recovery in Stream Feeds API interactions

Applied to files:

  • packages/stream_feeds/test/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.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/test/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/feeds_client.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/test/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/models.dart
  • packages/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} : 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/test/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/models/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/CHANGELOG.md
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/feeds_client.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/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models.dart
  • packages/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} : Use batch operations for bulk activity creation and updates to optimize API performance

Applied to files:

  • packages/stream_feeds/test/client/feeds_client_test.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/feeds_client.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/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • 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 : Use `freezed` for all data classes in the Stream Feeds SDK

Applied to files:

  • packages/stream_feeds/lib/src/models/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • 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 : Model naming convention: Use `*Data` suffix for model classes (e.g., `ActivityData`, `FeedData`)

Applied to files:

  • packages/stream_feeds/lib/src/models/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models.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/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • packages/stream_feeds/lib/src/models.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/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.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/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • packages/stream_feeds/lib/src/models.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/activity_data.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.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/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/feeds_client.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/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.dart
  • packages/stream_feeds/lib/src/models.dart
  • packages/stream_feeds/lib/src/feeds_client.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/lib/src/models/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds_test/lib/src/helpers/test_data.dart
  • packages/stream_feeds/lib/src/feeds_client.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/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.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/request/feed_add_activity_request.dart
  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/models.dart
  • packages/stream_feeds/lib/src/feeds_client.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/activity_data.dart
  • 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/generated/**/*.dart : Never manually edit generated files (`*.freezed.dart`, `*.g.dart`, `src/generated/`)

Applied to files:

  • packages/stream_feeds/lib/src/models/activity_data.dart
  • packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.dart
  • 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/repository/**/*.dart : All repository methods must return `Result<T>` types for explicit error handling

Applied to files:

  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_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 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.dart
  • packages/stream_feeds/lib/src/feeds_client.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/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_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/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_repository.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 : Return `Result<T>` from all repository methods in Dart

Applied to files:

  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_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 : Apply early return patterns for clean control flow in repository methods

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/lib/src/**/*.dart : Use `//` for internal/private code documentation

Applied to files:

  • packages/stream_feeds/lib/src/client/feeds_client_impl.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 repository methods must return Result types for explicit error handling

Applied to files:

  • packages/stream_feeds/lib/src/client/feeds_client_impl.dart
  • packages/stream_feeds/lib/src/repository/collections_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 extension functions on API response types for clean response transformation

Applied to files:

  • packages/stream_feeds_test/lib/src/helpers/test_data.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/collection_data.dart
  • packages/stream_feeds/lib/src/models.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/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.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/collection_data.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/collection_data.dart
  • packages/stream_feeds/lib/src/models/collection_data.freezed.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/collection_data.freezed.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.dart
🪛 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 collections API methods: `readCollectio...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~8-~8: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ollections, and deleteCollections. - Add CollectionDatamodel andcollections...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~9-~9: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tyDatafor enriched collection data. - AddcollectionRefsfield toFeedAddActiv...

(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
🔇 Additional comments (32)
packages/stream_feeds_test/lib/src/helpers/test_data.dart (3)

84-98: LGTM!

The addition of the collections parameter to createDefaultActivityResponse follows the existing pattern and maintains backward compatibility with a sensible default.


1055-1091: LGTM!

The new collection response helpers follow the established patterns in the file with appropriate default values and consistent signatures.


1093-1122: LGTM!

The collection CRUD response helpers are complete and follow the established patterns. The delete response appropriately uses a const constructor with only duration, matching similar responses in the file.

packages/stream_feeds/lib/src/models.dart (1)

8-8: LGTM!

The export statement is correctly placed alphabetically and properly exposes the new CollectionData model to the public API.

packages/stream_feeds/test/client/feeds_client_test.dart (4)

730-783: LGTM!

The readCollections test group provides comprehensive coverage with both success and failure paths. The tests properly verify API interaction and response data.


785-860: LGTM!

The createCollections test group is well-structured with proper fallback registration and comprehensive validation of both success and failure scenarios.


862-936: LGTM!

The updateCollections test group follows the established testing pattern and provides adequate coverage for update operations.


938-978: LGTM!

The deleteCollections test group provides complete coverage for deletion operations. Note that no fallback registration is needed since the operation uses URL parameters rather than a request body.

packages/stream_feeds/lib/src/models/collection_data.dart (3)

7-55: LGTM!

The CollectionData model correctly follows the coding guidelines:

  • Uses @freezed with mixed mode and @override annotations
  • Follows the *Data suffix naming convention
  • Has a required id field
  • Places custom field last
  • Includes comprehensive documentation

Based on learnings and coding guidelines.


57-70: LGTM!

The CollectionStatus extension type provides type-safe status values using modern Dart 3.0+ features. The implementation is clean and well-documented.


72-99: LGTM!

The mapper extensions correctly follow the coding guidelines:

  • Use extension functions with .toModel() pattern instead of mapper classes
  • Apply pattern matching with switch expressions
  • Properly map all API response fields to domain model fields

Based on learnings and coding guidelines.

packages/stream_feeds/lib/src/models/request/feed_add_activity_request.dart (2)

19-54: LGTM!

The collectionRefs field is properly integrated with:

  • Clear documentation explaining the format and 10-collection limit
  • Correct placement in the constructor
  • Proper @override annotation following Freezed 3.0 mixed mode syntax

135-155: LGTM!

The collectionRefs field is correctly included in the mapper extension, following the .toModel() pattern and passing the value through to the API request.

packages/stream_feeds/lib/src/models/request/feed_add_activity_request.freezed.dart (1)

1-246: LGTM! Generated code follows Freezed patterns correctly.

This is generated code from the Freezed package. The addition of the collectionRefs field is properly integrated into the equality, hashCode, toString, and copyWith implementations following standard Freezed conventions.

packages/stream_feeds/lib/src/models/collection_data.freezed.dart (1)

1-130: LGTM! Generated code for new CollectionData model.

This is properly generated Freezed code for the new CollectionData model. The implementation includes all standard Freezed features: value equality, immutability, copyWith functionality, and proper handling of the custom Map field using DeepCollectionEquality.

packages/stream_feeds/lib/src/feeds_client.dart (7)

661-661: LGTM! Improved example specificity.

The updated example now demonstrates accessing nested configuration properties, which is more helpful than a generic example.


748-748: LGTM! Improved API clarity with named parameters.

The documentation examples now use named parameter syntax (url: ...) which makes the API more self-documenting and follows Dart best practices.

Also applies to: 770-770


855-876: LGTM! Well-documented read operation.

The documentation clearly explains the method's purpose, permission constraints, and provides a practical example. Follows Effective Dart guidelines and established SDK patterns.


878-908: LGTM! Clear documentation with context.

The documentation effectively explains what collections are and how they're used, with a practical example showing batch creation. Follows established patterns for batch operations.


910-939: LGTM! Clear update constraints documented.

The documentation clearly specifies that only custom data is updatable and permission constraints. The example demonstrates the correct usage pattern.


941-962: LGTM! Consistent delete operation documentation.

The documentation clearly explains the method's purpose and permission constraints. The example demonstrates proper batch deletion usage.


994-1000: LGTM! Helpful integration example.

The updated example demonstrates how to attach collection references to activities, showing the practical integration of the new Collections API feature.

packages/stream_feeds/lib/src/models/activity_data.freezed.dart (1)

1-449: LGTM! Generated code correctly adds collections field.

This is generated Freezed code that properly integrates the collections field into ActivityData. The implementation correctly uses DeepCollectionEquality for the Map field and follows all Freezed conventions.

packages/stream_feeds/lib/src/client/feeds_client_impl.dart (5)

22-22: LGTM! Repository integration follows established patterns.

The CollectionsRepository is properly integrated following the same pattern as other repositories: imported, initialized in the constructor with the feedsApi dependency, and declared as a late final field.

Also applies to: 165-165, 203-203


547-552: LGTM! Proper delegation for read operation.

The implementation correctly delegates to the repository, maintaining the Result type pattern and requiring no additional side effects for a read operation.


554-559: LGTM! Correct delegation pattern.

The implementation properly delegates to the repository. Note that unlike getOrCreateFollows, this doesn't emit state update events, which appears intentional as there's likely no collection-specific state management yet in the SDK.


561-566: LGTM! Consistent update operation.

The implementation follows the same delegation pattern as other methods, maintaining consistency across the Collections API surface.


568-573: LGTM! Complete CRUD implementation.

The delete operation completes the Collections API CRUD implementation with consistent delegation pattern and proper Result type usage.

packages/stream_feeds/lib/src/models/activity_data.dart (2)

78-83: Well-documented collections field.

The field declaration follows the @freezed pattern correctly with the @OverRide annotation, and the documentation clearly explains the collections map structure and reference format.


276-279: Clean mapping implementation.

The collections mapping follows the established pattern used for other map fields in this mapper (e.g., reactionGroups). The use of map comprehension with .toModel() extension is idiomatic and consistent.

packages/stream_feeds/lib/src/repository/collections_repository.dart (2)

5-19: Repository structure follows best practices.

The class uses constructor injection for dependencies, returns Result types for error handling, and properly documents its purpose. The private field correctly uses // for internal documentation.


32-64: Clear documentation of CRUD operations.

The create, update, and delete methods have clear documentation that explains their purpose, constraints (e.g., "only custom data field is updatable"), and permission requirements (e.g., "users can only update their own collections"). This provides good guidance for API consumers.

@xsahil03x xsahil03x merged commit 4d1fd0a into main Jan 9, 2026
11 of 13 checks passed
@xsahil03x xsahil03x deleted the feat/collection-api branch January 9, 2026 12:36
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.

Expose collections field in ActivityData model

3 participants