Commit Graph

15 Commits

Author SHA1 Message Date
Jeff Emmett f54f537483 Fix pingerName crash + auto-redirect returning users to last room
1. Server: pingerName was used before declaration in the WS message
   block (defined inside the push block). Moved declaration above both
   blocks. This caused all /push/request-location calls to crash with
   ReferenceError.

2. Landing page: always auto-redirect returning users (have saved user
   + last room) instead of only in standalone mode. Shows a loading
   spinner during redirect so the landing page doesn't flash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 00:44:19 +00:00
Jeff Emmett a1132371f4 Thread caller name through ping notifications
Ping notifications now show who pinged: "<Name> pinged you for your
location!" instead of generic "Someone is looking for you". Caller name
flows through WS messages, silent push payloads, SW postMessage, URL
params (?pinger=), and visible push notifications.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 00:35:54 +00:00
Jeff Emmett 0bea3ba73b feat: persist offline users and push subscriptions to disk
Rooms and push subscriptions now survive server restarts via JSON files
on a Docker volume. Stale participant cleanup skips users who have
active push subscriptions — they remain in the room and can still be
pinged for location and notifications when offline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 00:10:53 +00:00
Jeff Emmett a54ae04140 feat: manual ping vibrates device and force-shares GPS location
Manual "Ping All" now sends `manual: true` flag through WebSocket and
push channels. Receiving clients vibrate and respond with a one-shot
getCurrentPosition() regardless of sharing toggle. Auto-periodic 60s
pings stay silent and only respond if sharing is enabled.

Also fixes: SW cache invalidation (v2→v3), navigation requests now
network-first, sync server lastSeen uses ISO strings, Dockerfile
includes verify-token.js.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 00:06:05 +00:00
Jeff Emmett 30f32e6da7 fix: deduplicate participants, visible callout push for offline users, fix notification timing
- Server-side participant dedup on join: remove ghost entries with same name but different ID
- Reduce stale participant threshold from 1hr to 15min to match client-side cleanup
- Refactor push subscriptions from Set to Map keyed by endpoint (prevents duplicate pushes)
- Store participantId with push subscriptions for identity-aware routing
- Exclude joining user from their own "Friend Joined" push notification
- Callout (ping) sends visible push to offline users ("X is looking for you!") instead of silent push
- Return last known locations in callout API response for immediate display
- Service worker: 10s cooldown on location request pushes to prevent burst on app reopen
- Service worker: suppress join/leave notifications when app window is focused
- Pass callerName from ParticipantList so offline callout shows who's looking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 14:01:56 -07:00
Jeff Emmett f174709086 feat: add EncryptID auth to sync server and gate room creation
Verify JWT tokens on WebSocket connections via query param. Check room
visibility before allowing access. Block writes from read-only connections.
Add room config endpoint. Require auth for creating new rooms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:54:20 -07:00
Jeff Emmett c34a84672a feat: Bell icon for pings and individual user ping support
- Changed ping button icon from circular arrows to bell with brackets
- Added individual ping button on each participant row
- Server now supports targeting specific participant by ID
- Deduplication still applies (only pings one session per name)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:32:25 +01:00
Jeff Emmett ff45193ba2 feat: Grey out stale locations, remove indoor map, dedupe pings
1. Stale locations (>5 min old) are now greyed out on the map with
   reduced opacity and hover tooltip showing time since last seen
2. Removed indoor map button and related UI elements
3. Location request pings now deduplicate by participant name to
   avoid pinging the same user multiple times

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:06:52 +01:00
Jeff Emmett d6a20f9500 feat: Add WebSocket-based location refresh for online friends
- Server sends request_location via WebSocket to connected clients
- Falls back to silent push for offline/background clients
- Client responds with current GPS location when requested
- Refresh button now works for online friends (no push subscription needed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 01:51:09 +01:00
Jeff Emmett 6e360c6b6a fix: Use correct waypoint type 'meetup' instead of 'meeting_point'
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 01:37:50 +01:00
Jeff Emmett 4ee33f4992 feat: Add /push/request-location endpoint for manual location pings
- POST /push/request-location with { roomSlug } triggers silent push
- Returns count of sent/failed notifications
- Useful for on-demand location refresh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 01:30:14 +01:00
Jeff Emmett ca1cd4877d feat: Add automatic periodic location requests via silent push
- Server sends silent push notifications every 60s (configurable)
- Only requests from rooms with active participants
- Cleans up stale push subscriptions automatically
- Interval configurable via LOCATION_REQUEST_INTERVAL env var

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 01:27:00 +01:00
Jeff Emmett dcb6657966 feat: Add PWA push notifications for room events
- Add service worker (sw.js) for push notification handling
- Add usePushNotifications hook for subscription management
- Add NotificationToggle component in room header
- Update sync server with web-push for sending notifications
- Add VAPID keys configuration
- Notifications for: friend joins, friend leaves, meeting points set

Push notification events:
- Friend joins room: "Friend Joined! 👋"
- Friend leaves room: "Friend Left"
- Meeting point set: "Meeting Point Set! 📍"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 01:13:16 +01:00
Jeff Emmett 003d3b0187 feat: Add waypoint modal and preserve offline user locations
- Add WaypointModal component with delete and navigate actions
- Navigate button opens Google Maps directions to waypoint
- Delete button removes waypoint with confirmation
- Sync server now preserves offline users' last locations
- Users marked as offline instead of removed when disconnecting
- Stale participant cleanup still runs after 1 hour threshold

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 00:58:10 +01:00
Jeff Emmett 8554a4cb1a feat: Add WebSocket sync server for real-time location sharing
- Add sync-server/ with Node.js WebSocket relay server
- Server handles join/leave/location/waypoint messages
- Auto-cleans stale participants (1hr) and empty rooms (24hr)
- Dockerized with Traefik labels for easy deployment
- Update .env.example with NEXT_PUBLIC_SYNC_URL
- Mark task-5 as Done in backlog

Deployed to https://sync.rmaps.online

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:00:55 -05:00