feat: implement patch#42
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughIntroduces a comprehensive in-app notification system with real-time updates via Ably, a notification center UI with filtering and grouping, granular user preferences with email quiet hours, and integrations for mentions, reactions, comments, follows, and game events across the platform. ChangesIn-App Notification System
Sequence DiagramssequenceDiagram
participant User as User Action
participant API as API Service
participant DB as Database
participant Ably as Ably
participant Frontend as Frontend
User->>API: Mention User / React / Comment / etc.
API->>API: Validate preferences, check mute, deliverability
API->>DB: Create notification row
DB-->>API: Return notification id
API->>Ably: Publish to user:recipientId:inbox
Ably-->>Frontend: Broadcast NOTIFICATION_NEW
Frontend->>Frontend: Update unread count & list cache
Frontend-->>User: Update bell badge & list
sequenceDiagram
participant Frontend1 as Tab 1
participant Frontend2 as Tab 2
participant Ably as Ably Channel
participant API as API (preferences check)
Frontend1->>Frontend1: useUserInboxChannel mounted
Frontend1->>Ably: Subscribe to user:userId:inbox
Frontend2->>Frontend2: useUserInboxChannel mounted
Frontend2->>Ably: Subscribe to user:userId:inbox
Frontend1->>API: Mark notification as read
API->>Ably: Publish NOTIFICATION_READ event
Ably-->>Frontend1: Receive event
Ably-->>Frontend2: Receive event (cross-tab)
Frontend1->>Frontend1: Update cache
Frontend2->>Frontend2: Update cache (synced)
sequenceDiagram
participant Service as API Service
participant Prefs as Preferences Cache
participant Follow as Follow Check
participant QuietHours as Quiet Hours
Service->>Service: Before sending email
Service->>Prefs: Load user notification preferences
Prefs-->>Service: Return prefs
Service->>Service: Check if category is muted
alt Category muted or muteAllExceptSecurity
Service-->>Service: Skip email
else Category enabled
Service->>Follow: Check if delivery level requires follower
alt Level is "followers" and not following
Service-->>Service: Skip email
else Delivery allowed
Service->>QuietHours: Check if in email quiet hours
QuietHours-->>Service: isInQuietHours?
alt In quiet hours
Service-->>Service: Skip email
else Not in quiet hours
Service-->>Service: Send email
end
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
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.
Summary by CodeRabbit
New Features