Repository navigation
fix(server): normalize PUBLIC_APP_URL to origin in pulse emails - #641
Merged
Merged
Conversation
gkhngyk
approved these changes
Aug 4, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Exactly the fix from the issue — origin normalization plus the one-time operator warning. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PUBLIC_APP_URLis set with a path (e.g.https://app.example.com/dashboard/insightsinstead of the bare origin),appUrl()inserver/src/lib/pulse/engine.jsonly stripped a trailing slash, so the path passed through untouched. The pulse engine then appends its own paths, producing doubled URLs like/dashboard/insights/dashboard/insightsfor the CTA and/dashboard/insights/dashboard/settings?tab=notificationsfor the manage-notifications footer link — this happened in a real deployment.appUrl()now parses the value withnew URL(value).origin(falling back to the raw value if parsing fails) and logs a one-time warning via the existingloggerwhen the configured value contains a path, so the operator learns their env is misconfigured instead of emails silently breaking.http://localhost:3000) behavior is unchanged.Related issue
Closes #639
Type of change
fix— Bug fixChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdnpm run lintpasses (run fromserver/; this PR only touchesserver/, noweb/changes)npm run format:checkpasses (run fromserver/)npm run testpasses (run fromserver/, 147/147 tests — no existing test file covers thepulse/module, so none were added for this small, isolated fix)