Skip to content

feat(group_profile): add group notification toggles and leave sheet - #735

Merged
tentamdin merged 8 commits into
developfrom
feat/group-notification-controls
Sep 18, 2026
Merged

tentamdin merged 8 commits into
developfrom
feat/group-notification-controls

Conversation

@tentamdin

Copy link
Copy Markdown
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
tentamdin marked this pull request as ready for review September 8, 2026 18:32
@greptile-apps

greptile-apps Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the latest change fully addresses the remaining stale-rollback behavior without introducing a new actionable failure.

Summary

The PR adds per-group chat and content notification controls, a confirmed leave-group flow, master push registration reconciliation, event-reminder navigation, and foreground chat-notification suppression. The latest revision correctly updates the confirmed rollback target after every successful serialized preference write, including a success superseded by a later queued write.

  • Adds group notification preference API, domain, provider, and bottom-sheet UI layers.
  • Unregisters push devices when the application-wide notification switch is disabled.
  • Routes event reminders and suppresses foreground banners for the currently visible chat.
  • Adds focused model, provider, widget, routing, navigation, and master-switch tests.
Diagram
sequenceDiagram
  actor User
  participant Sheet as Group settings sheet
  participant Queue as Per-toggle write queue
  participant API as Preferences API
  User->>Sheet: Change group toggle
  Sheet->>Sheet: Apply optimistic value
  Sheet->>Queue: Queue latest value
  Queue->>API: PATCH serialized value
  API-->>Queue: Confirm backend state
  Queue->>Queue: Update persisted rollback target
  alt Newer value queued
    Queue->>API: PATCH newer value
    alt Newer write fails
      API-->>Queue: Failure
      Queue-->>Sheet: Restore last confirmed value
    else Newer write succeeds
      API-->>Queue: Confirm final state
      Queue-->>Sheet: Display confirmed value
    end
  else Queue drained
    Queue-->>Sheet: Display confirmed value
  end
Loading

Reviews (4) · Last reviewed commit: "fix(group_profile): track superseded suc..."

Comment thread lib/features/group_chat/presentation/providers/group_chat_providers.dart Outdated
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 thread lib/features/push_notifications/application/push_notification_service.dart Outdated
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.
@tentamdin

Copy link
Copy Markdown
Member Author

@greptileai review

Read and write /users/me/notification-preferences/groups/{id}. Group chat
maps to CHAT_MESSAGE; group content maps to GROUP_POST, EVENT and
ACCUMULATION together, reading on only when all are enabled and unmuted.
Turning a toggle on also lifts any snooze. The sheet now fetches on open
and shows spinners until the stored values arrive.
@tentamdin

Copy link
Copy Markdown
Member Author

@greptileai

Comment thread lib/features/group_chat/presentation/screens/group_chat_screen.dart
…how load errors

Serialize PATCHes per toggle so the backend ends on the value shown.
Release the active chat room while another page covers it. Show a
retry row instead of defaults when preferences fail to load.
Adopt develop's ForegroundPushFilter for banner suppression and drop the
branch's own active-room mechanism; keep the master switch, reminder
routing and preference work.
…target

A preference write that succeeded while a newer value was queued was
skipped entirely, so a later failure reverted the switch to a stale value
the backend no longer held. Record every confirmed value before checking
for a queued write.
@tentamdin
tentamdin merged commit 7ea1ab3 into develop Sep 18, 2026
1 of 2 checks passed
@tentamdin tentamdin mentioned this pull request Sep 21, 2026
@TenzDelek
TenzDelek deleted the feat/group-notification-controls branch September 23, 2026 04:37
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