Skip to content

feat(llc): expose deleteNotificationActivity on delete methods - #110

Open
renefloor wants to merge 5 commits into
mainfrom
renefloor/flu-372-feeds-notification-updates
Open

feat(llc): expose deleteNotificationActivity on delete methods#110
renefloor wants to merge 5 commits into
mainfrom
renefloor/flu-372-feeds-notification-updates

Conversation

@renefloor

@renefloor renefloor commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added optional deleteNotificationActivity: bool? to Feed.deleteActivity, Feed.deleteComment, Feed.deleteActivityReaction, Feed.deleteCommentReaction, Activity.deleteComment, and Activity.deleteCommentReaction
  • Plumbed through the repository layer to the generated API delete_notification_activity query param (already present from codegen feat(llc): update openapi models #106)
  • New notification types mention and comment_mention require no SDK changes — they are standard activity types handled generically; the snippet documents how to read them

Relevance check

The delete_notification_activity query param was already in the generated DefaultApi (PR #106) but was not exposed on any public SDK method. New notification types (mention, comment_mention) only need docs — they appear as activity types in aggregated notification activities with no special handling needed.

Test plan

  • melos run analyze — no issues
  • flutter test in packages/stream_feeds — all 392 tests pass
  • Docs snippet in docs/code_snippets/05_06_notification_feeds.dart (new functions) compiles cleanly

Closes FLU-372

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added an option to remove related notifications when deleting activities, comments, or reactions.
    • Expanded examples to show how to read mention notifications and delete content while also clearing associated notifications.
  • Bug Fixes

    • Improved consistency so deletion actions can now clean up the linked notification entry at the same time.
  • Chores

    • Updated the changelog and added test coverage for the new deletion behavior.

Plumbs the delete_notification_activity query param through all public
delete methods (deleteActivity, deleteComment, deleteActivityReaction,
deleteCommentReaction) on Feed and Activity state objects and their
underlying repositories. Defaults to null (existing behaviour unchanged).

Also adds docs snippet for mention/comment_mention notification types
and the new delete-with-notification pattern.

Closes FLU-372

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@renefloor
renefloor requested a review from a team as a code owner June 17, 2026 12:46
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds an optional deleteNotificationActivity boolean parameter to delete methods for activities, comments, and their reactions across the repository, state (Activity, Feed) layers, forwarding the flag to underlying API calls. Tests validate the new parameter, and docs/changelog are updated accordingly.

Changes

Notification Deletion Flag

Layer / File(s) Summary
Repository layer parameter wiring
packages/stream_feeds/lib/src/repository/activities_repository.dart, packages/stream_feeds/lib/src/repository/comments_repository.dart
deleteActivity, deleteActivityReaction, deleteComment, and deleteCommentReaction each add an optional deleteNotificationActivity parameter forwarded to the underlying API calls.
Activity state delete methods
packages/stream_feeds/lib/src/state/activity.dart, packages/stream_feeds/test/state/activity_test.dart
Activity.deleteComment and deleteCommentReaction accept and forward the new parameter to the comments repository, with new tests verifying it reaches the mocked API.
Feed state delete methods
packages/stream_feeds/lib/src/state/feed.dart, packages/stream_feeds/test/state/feed_test.dart
Feed.deleteActivity, deleteComment, deleteActivityReaction, and deleteCommentReaction accept and forward the new parameter to their repositories, validated by four new tests.
Documentation and changelog
docs/code_snippets/05_06_notification_feeds.dart, packages/stream_feeds/CHANGELOG.md
Adds readMentionNotifications() and deleteWithNotification() example snippets, and documents the new parameter in the changelog.

Estimated code review effort: 2 (Simple) | ~15 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: exposing deleteNotificationActivity on delete methods.
Description check ✅ Passed The description covers summary, rationale, tests, and closure, though it omits template items like CLA checks and screenshots.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch renefloor/flu-372-feeds-notification-updates

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.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.53%. Comparing base (a1590dd) to head (b4d899a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #110   +/-   ##
=======================================
  Coverage   85.53%   85.53%           
=======================================
  Files         124      124           
  Lines        4342     4342           
=======================================
  Hits         3714     3714           
  Misses        628      628           

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

renefloor and others added 2 commits June 18, 2026 10:05
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@renefloor
renefloor marked this pull request as draft June 18, 2026 13:45
@renefloor
renefloor marked this pull request as ready for review July 9, 2026 11:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/stream_feeds/lib/src/state/feed.dart (1)

259-283: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document deleteNotificationActivity across all four delete methods.

deleteActivity, deleteComment, deleteActivityReaction, and deleteCommentReaction all gain the new optional deleteNotificationActivity parameter, but none of their dartdoc blocks mention it, despite each block documenting the other params.

📝 Suggested doc addition (repeat for the other three methods)
   /// Deletes an activity from the feed.
   ///
   /// The [id] is the unique identifier of the activity to delete.
   /// If [hardDelete] is `true`, the activity will be permanently deleted. If `false`, it will be
   /// soft deleted. (default is `false`)
+  /// If [deleteNotificationActivity] is `true`, the notification activity created for this
+  /// activity (e.g. a mention) is also deleted.
   /// Returns a [Result] indicating success or failure of the deletion operation.

As per path instructions, **/@(lib|packages)/**/*.dart should "Use /// for public API documentation ... following Effective Dart style".

Also applies to: 470-496, 793-821, 852-880

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stream_feeds/lib/src/state/feed.dart` around lines 259 - 283, The
dartdoc for the delete methods in Feed is missing the new optional
deleteNotificationActivity parameter, even though the signatures already include
it. Update the public API docs for deleteActivity, deleteComment,
deleteActivityReaction, and deleteCommentReaction to describe
deleteNotificationActivity alongside the existing parameters, using the same ///
style and wording pattern already used in Feed.

Source: Path instructions

packages/stream_feeds/lib/src/state/activity.dart (1)

225-238: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the new deleteNotificationActivity parameter.

Both deleteComment and deleteCommentReaction document existing params ([hardDelete], [commentId], [type]) but the new deleteNotificationActivity flag isn't mentioned in either dartdoc block.

📝 Suggested doc additions
   /// Deletes a comment by its ID.
   ///
   /// When [hardDelete] is true, permanently deletes the comment; otherwise marks it as deleted.
+  ///
+  /// When [deleteNotificationActivity] is true, also deletes the notification activity
+  /// created for this comment (e.g. mention notifications).
   ///
   /// Returns a [Result] containing void or an error.
   /// Removes a reaction from a comment.
   ///
   /// Returns a [Result] containing the removed [FeedsReactionData] or an error.
+  ///
+  /// When [deleteNotificationActivity] is true, also deletes the notification activity
+  /// created for this reaction.

As per path instructions, **/@(lib|packages)/**/*.dart should "Use /// for public API documentation ... following Effective Dart style".

Also applies to: 303-314

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/stream_feeds/lib/src/state/activity.dart` around lines 225 - 238,
The public API docs for deleteComment and deleteCommentReaction are missing the
new deleteNotificationActivity parameter. Update the Dartdoc blocks on those
methods to mention deleteNotificationActivity alongside the existing parameter
descriptions, using the same /// style and Effective Dart wording as the other
documented args. Keep the descriptions aligned with the method signatures so the
parameter is discoverable in activity.dart.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/stream_feeds/lib/src/state/activity.dart`:
- Around line 225-238: The public API docs for deleteComment and
deleteCommentReaction are missing the new deleteNotificationActivity parameter.
Update the Dartdoc blocks on those methods to mention deleteNotificationActivity
alongside the existing parameter descriptions, using the same /// style and
Effective Dart wording as the other documented args. Keep the descriptions
aligned with the method signatures so the parameter is discoverable in
activity.dart.

In `@packages/stream_feeds/lib/src/state/feed.dart`:
- Around line 259-283: The dartdoc for the delete methods in Feed is missing the
new optional deleteNotificationActivity parameter, even though the signatures
already include it. Update the public API docs for deleteActivity,
deleteComment, deleteActivityReaction, and deleteCommentReaction to describe
deleteNotificationActivity alongside the existing parameters, using the same ///
style and wording pattern already used in Feed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b647d179-8447-49a2-8e3b-a52f072bd4aa

📥 Commits

Reviewing files that changed from the base of the PR and between a1590dd and b4d899a.

📒 Files selected for processing (8)
  • docs/code_snippets/05_06_notification_feeds.dart
  • packages/stream_feeds/CHANGELOG.md
  • packages/stream_feeds/lib/src/repository/activities_repository.dart
  • packages/stream_feeds/lib/src/repository/comments_repository.dart
  • packages/stream_feeds/lib/src/state/activity.dart
  • packages/stream_feeds/lib/src/state/feed.dart
  • packages/stream_feeds/test/state/activity_test.dart
  • packages/stream_feeds/test/state/feed_test.dart

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.

1 participant