feat(group_profile): add group notification toggles and leave sheet - #735
Open
tentamdin wants to merge 4 commits into
Open
feat(group_profile): add group notification toggles and leave sheet#735tentamdin wants to merge 4 commits into
tentamdin wants to merge 4 commits into
Conversation
tentamdin
commented
Sep 8, 2026
Member
- Joined button opens a sheet with per-group chat and content push toggles and a confirmed Leave group action.
- Master switch off now unregisters the push device and greys out the toggles.
- Route EVENT_REMINDER pushes to the event, and skip the foreground banner for the open chat room.
Joined button opens a sheet with per-group chat and content push toggles and a confirmed Leave group action. Master switch off now unregisters the push device and greys out the toggles. Route EVENT_REMINDER pushes to the event, and skip the foreground banner for the open chat room.
Claiming the active room from initState and dispose tripped Riverpod's lifecycle guard and red-screened the chat screen. Use a plain holder object instead; push suppression reads it the same way.
tentamdin
marked this pull request as ready for review
September 8, 2026 18:32
Contributor
The PR is not yet safe to merge because a transient unregister failure can leave an opted-out device receiving server push notifications. Findings
Prompt To Fix All With AI### Issue 1
lib/features/push_notifications/application/push_notification_service.dart:216-218
When device unregistration fails after the signed-in user disables the master notification switch, this branch only logs the failure after the reconciliation loop has cleared its pending-work flag. No automatic retry is scheduled, so the backend registration remains active and background or terminated-state notifications continue until an unrelated event triggers another reconciliation.
**How this was verified:** The failure branch leaves the stored registration intact, and reconciliation restarts only when another request is already pending.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
|
Master switch flips during an in-flight register or unregister could leave the device registered after opt-out, or lose the id of a fresh registration. Route both through one reconcile loop that re-reads state after each pass. Track open chat rooms as a stack so popping one chat re-mutes the one under it.
Comment on lines
+216
to
+218
| final result = await _repository.unregisterDeviceToken(serverId); | ||
| await result.fold( | ||
| (failure) async => |
Contributor
There was a problem hiding this comment.
When device unregistration fails after the signed-in user disables the master notification switch, this branch only logs the failure after the reconciliation loop has cleared its pending-work flag. No automatic retry is scheduled, so the backend registration remains active and background or terminated-state notifications continue until an unrelated event triggers another reconciliation.
How this was verified: The failure branch leaves the stored registration intact, and reconciliation restarts only when another request is already pending.
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/features/push_notifications/application/push_notification_service.dart
Line: 216-218
Comment:
**Failed opt-out is not retried**
When device unregistration fails after the signed-in user disables the master notification switch, this branch only logs the failure after the reconciliation loop has cleared its pending-work flag. No automatic retry is scheduled, so the backend registration remains active and background or terminated-state notifications continue until an unrelated event triggers another reconciliation.
**How this was verified:** The failure branch leaves the stored registration intact, and reconciliation restarts only when another request is already pending.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.A master-switch opt-out whose DELETE failed offline left the device registered until some unrelated event reconciled again. Retry failed passes with linear backoff up to five times; an explicit request cancels a pending retry.
Member
Author
|
@greptileai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.