---
id: TASK-13
title: 'Fix rMaps dedup, callouts, and push notification bugs'
status: Done
assignee: []
created_date: '2026-02-15 21:02'
labels:
  - bugfix
  - push-notifications
  - sync
dependencies: []
priority: high
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Fixed three interrelated bugs in rmaps-online:

1. **Duplicate participants**: Server-side dedup on join removes ghost entries with same name but different ID. Stale threshold reduced from 1hr to 15min.
2. **Callouts for offline users**: Pinging now sends a visible push notification ("X is looking for you!") to offline users instead of a silent push. Response includes last known locations.
3. **Notification timing**: Push subscriptions deduped by endpoint (prevents duplicate pushes). Joining user excluded from their own "Friend Joined" notification. Service worker has 10s cooldown on location request pushes to prevent burst on reopen. Join/leave notifications suppressed when app is focused.
<!-- SECTION:DESCRIPTION:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Committed as 30f32e6 and pushed to Gitea main. Files changed: sync-server/server.js, public/sw.js, src/hooks/usePushNotifications.ts, src/app/[slug]/page.tsx, src/components/room/ParticipantList.tsx
<!-- SECTION:FINAL_SUMMARY:END -->
