Implement membership notifications and deep-link handling for Electron desktop app #246
Reference in New Issue
Block a user
Delete Branch "free-monkey"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary by CodeRabbit
New Features
Security
Documentation
📝 Walkthrough
Walkthrough
This PR adds member-join email notifications to the network service and implements OS-level deep-link routing in the Electron desktop app, including mocks, wiring, templates, preload contracts, main-process handlers, and renderer navigation.
Changes
Member Join Email Notifications
go/internal/human/service.go,go/internal/human/mocks/service.goMockServicewith methods for lookup, creation, listing, and notification-state updates to support tests.go/internal/network/service.go,go/cmd/orion/main.gohumanLookupinterface, wire it intoserviceImpl, updateNewServicesignature, and main now passes a Firestore-backed membership publisher.go/internal/network/service.go,go/internal/network/service_test.goAcceptInvitationpreloads prior member IDs, resolves human records, filters recipients, and sends “new member joined” emails; templates use centralized URL constants and shared desktop footer; tests pass a mocked human service.go/internal/network/service_test.goGetByID, and pass it intonetwork.NewServicewith the new arity..gitignore,go/Taskfile.yml.gitignoreentry fortagsand addgo fmt ./...format step to Taskfile generate task.Electron Deep Linking
js/desktop/src/electron.d.ts,js/desktop/src/preload.tsWindowtype extended withelectronDeepLinkand preload exposesgetPending()andonNavigate()to the renderer.js/desktop/src/main.tsdeepLinkPath/tryNavigateToDeepLink, store pending deep links for cold-starts, route OSllink://events, register IPC to deliver pending links, tightenwebPreferences, and remove prior CORS header injection.js/desktop/src/App.tsxDeepLinkNavigationListenerfetches pending deep-links on mount and subscribes to future navigate events viaelectronDeepLink, navigating with React Router.js/desktop/README.md,js/desktop/package.jsoncross-env APP_ENV=prod.Sequence Diagrams
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
free-monkeyComment
@coderabbitai helpto get the list of available commands and usage tips.Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
09d6616b-68c6-4a27-ab02-d79b6565c946📥 Commits
Reviewing files that changed from the base of the PR and between
9184d002d3ande3bd3b7aa6.📒 Files selected for processing (13)
.gitignorego/Taskfile.ymlgo/cmd/orion/main.gogo/internal/human/mocks/service.gogo/internal/human/service.gogo/internal/network/service.gogo/internal/network/service_test.gojs/desktop/README.mdjs/desktop/package.jsonjs/desktop/src/App.tsxjs/desktop/src/electron.d.tsjs/desktop/src/main.tsjs/desktop/src/preload.ts@@ -289,0 +378,4 @@<table role="presentation" width="100%%" cellspacing="0" cellpadding="0" border="0" style="max-width:480px;background-color:#ffffff;border-radius:12px;padding:40px;"><tr><td style="font-size:22px;font-weight:600;color:#111111;padding-bottom:16px;">A new member joined %s⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Honor notification preferences before sending join emails.
Line 280 appends every resolved member email without checking
EmailNotificationsEnabled(and without guarding blank emails). That can notify opted-out users and triggerShootEmailwith no valid recipients.[sraise_placeholder]
Proposed fix
🤖 Prompt for AI Agents
✅ Addressed in commit
60b1c3e@@ -0,0 +1,5 @@# Notes## CORS for desktop appIn dev: each renderer process has it's own localhost port. The renderer process passes this in the `Origin` header for requests, and expects appropriate ACAO headers in the response.⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Fix possessive pronoun.
Change "it's own" to "its own" (possessive, not contraction).
📝 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift
Deep-link listener is auth-gated and can drop OS deep links
DeepLinkNavigationListeneronly mounts in authenticated UI (Line 84). When auth flips away from authenticated, it unmounts, but the main process remains in “ready” mode and sends live deep-link events instead of queueing them; those events are lost before re-authentication.Keep deep-link subscription active across auth states, or add explicit ready/unready IPC lifecycle so main only live-sends when a listener is actually mounted.
🤖 Prompt for AI Agents