Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #266 +/- ##
==========================================
+ Coverage 18.12% 18.52% +0.40%
==========================================
Files 42 45 +3
Lines 1727 1884 +157
==========================================
+ Hits 313 349 +36
- Misses 1408 1526 +118
- Partials 6 9 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Dao-Ho
requested changes
Apr 4, 2026
Contributor
Dao-Ho
left a comment
There was a problem hiding this comment.
some smol nits but looks good otherwise 🐐 ✅
backend/supabase/migrations/20260404000001_create-notifications-table.sql
Show resolved
Hide resolved
leaving these custom errors in the notifs package bc they won't be used anyhwere else
2515105 to
a46c503
Compare
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.
Description
Implements the backend notification foundation.
When a task is created with an assigned user, that user is notified immediately - both as a persistent in-app notification (stored in db) and as a mobile push (sent to any registered Expo push tokens). The goal is to establish the pattern so different notification types (high-priority unassigned tasks, guest arrival, etc.) can be added later if we want
Type of Change
Related Issue(s)
Stacked on: #265
Closes: #97
What Changed?
NotificationsRepository- insert, list, mark read, mark all read, upsert/query device tokensnotifications.Service- persists the in-app notification then fire-and-forgets Expo push via goroutine to any registered device tokensNotificationsHandlerwith four endpoints:GET /notifications,PUT /notifications/:id/read,PUT /notifications/read-all,POST /device-tokensNotificationSenderinterface toRequestsHandler;CreateRequestandGenerateRequestnow trigger atask_assignednotification whenuser_idis setHow it works / (🤞 will work) with web and mobile
Web - poll
GET /api/v1/notifications(via auseNotificationsTanStack Query hook with some stale timeout) to drive the notification somewhere in the UI. CallPUT /notifications/:id/readorPUT /notifications/read-allwhen the user opens the panel.Mobile - on app startup, call
expo-notificationsto get the device'sExpoPushToken, thenPOST /api/v1/device-tokenswith the token and platform (ios/android). From that point the backend will deliver push notifications through Expo's push service whenever the user is assigned a task, even when the app is backgrounded.Testing & Validation
How this was tested
go build ./...compilesgo test ./internal/handler/... -vhandler tests pass (existing + new)Unfinished Work & Known Issues
expo-notificationsregistration flowNotes & Nuances
NotificationSenderis nilable onRequestsHandler- if nil, notifications are silently skipped. This keeps existing tests unaffected (they passnil) and makes the it safer to deploy before the frontend is wired upslogbut never fail the originating API call so a push outage shoulnd't break task creationPre-Merge Checklist
Code Quality
Testing & CI
Documentation