You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pulse email links silently break when PUBLIC_APP_URL includes a path — normalize to origin and warn #639
If PUBLIC_APP_URL is set with a path (e.g. https://app.example.com/dashboard/insights instead of the bare origin), every link in the Daily Pulse email silently breaks: the engine appends its own paths, producing URLs like /dashboard/insights/dashboard/insights for the CTA and /dashboard/insights/dashboard/settings?tab=notifications for the manage-notifications footer link.
This just happened in a real deployment — the emails went out with doubled paths and nothing warned about the misconfiguration.
Evidence
pulse/engine.js#L23-L25 — appUrl() only strips a trailing slash; a path passes through untouched
server/.env.example documents the correct origin-only form, but nothing enforces it
Suggested fix
Normalize in appUrl(): parse the value and use new URL(value).origin (falling back to the raw value if parsing fails), and log a one-time warning when the configured value contains a path so the operator learns their env is off. Keep the localhost default as-is.
Acceptance criteria
With PUBLIC_APP_URL=https://app.example.com/some/path, pulse emails link to https://app.example.com/dashboard/insights and a warning is logged at startup or first use.
With a correctly configured origin, behavior is unchanged.
Activity