inspectionId being present in the push data payload; if it is missing, the app does not navigate to the mentioned job—behavior that matches “opens the last work order I had open.”_membershipId: null and are skipped by the current push stream handler—out of scope for this story unless product explicitly expands scope.POST /note); PATCH updates do not call createMentionNotifications, so edits that add mentions do not re-run that path today.Backend — note create and mention fan-out
attik-backend/src/routes/notes.ts: after Note save, createMentionNotifications in attik-backend/src/util/notifications/notificationService.ts runs for mentions on the body. Individual @ users and @inspectors both call createNotification, which persists metadata including inspectionId from note._relatedInspectionIds?.[0], noteId, quoteId, senderId, and mentionType.@inspectors resolves recipients via getInspectorMemberships, which reads Inspection and active inspector Membership rows—snapshot at create time only.PATCH /:id handler in the same notes.ts file updates fields and saves but does not invoke createMentionNotifications._relatedInspectionIds consistently when the note belongs to a job; activity-feed patterns appear in e.g. attik-frontend/src/components/activityFeed/NotesInput.tsx and ActivityFeed.tsx (related job ids passed when posting).Backend — push payload
Notification inserts are watched in attik-backend/src/models/notificationSchema.ts, which forwards inserts to handleNotificationStream in attik-backend/src/events/streamHandlers/notificationStream.ts.buildPushTitle (sender name from Inspector.findById(metadata.senderId)), body via stripMentions on the stored message, assembles data (type, notificationId, noteId, target, optional inspectionId, senderId), and enqueues via queuePush from attik-backend/src/events/bullmq/pushWorker.ts into dispatchPush in attik-backend/src/util/functions/push/pushDispatchService.ts.@inspectors fan-out can stagger delivery slightly but is orthogonal to missing inspectionId.Mobile — tap handling
MentionPushData and getMentionNavigationPath in attik-mobile/hooks/usePushNotifications.ts require type === "mention" and a truthy inspectionId to return /inspection/{id}/notes.PushNotificationTapHandler in attik-mobile/app/_layout.tsx listens for notification opens (foreground and cold start) and router.pushes when a path is returned; otherwise it does nothing for navigation.POST push/register in attik-backend/src/routes/push.ts (same queue path conceptually).Decision needed
noteId-only) when inspectionId is absent—product and eng should align before implementation.attik-mobile/hooks/usePushNotifications.ts and tap routing in attik-mobile/app/_layout.tsx.attik-backend/src/models/notificationSchema.ts (metadata.inspectionId, noteId, etc.).attik-backend/src/util/notifications/notificationService.ts (createMentionNotifications, createNotification).attik-backend/src/events/streamHandlers/notificationStream.ts (handleNotificationStream).Please authenticate to join the conversation.
Planned
Main App
2 months ago
Linear
Get notified by email when there are changes.
Planned
Main App
2 months ago
Linear
Get notified by email when there are changes.