fix(desktop): canonicalize relay URL in welcome team scoping - #5309
fix(desktop): canonicalize relay URL in welcome team scoping#5309BradGroux wants to merge 2 commits into
Conversation
|
This is the third recurring review + rebase pass for the open BradGroux PRs on What this PR doesCanonicalizes the relay URL used as a community scope in the welcome-team ensured-marker storage key. The old code used the raw The fix imports the shared Correctness
Rebase resultAlready based on current main (
No code changes were made — this was a review + rebase pass only. |
7298de0 to
582fb63
Compare
|
Portfolio review update (2026-08-09) I reviewed this against current I rebased the branch, added migration of the exact legacy Welcome marker, strengthened starter reuse coverage across URL formatting variants, and rewrote the PR description to state the narrower scope. Focused onboarding and Welcome guide tests pass (34/34). The current head is |
Editing a community's Relay URL to a different string for the same relay orphaned the existing Welcome Team (Fizz/Honey/Bumble) and minted a fresh trio with new keypairs. Two places used bare exact-string comparison on the relay URL with no canonicalization: 1. welcomeChannelEnsuredStorageKey built a localStorage key from communityScope (the raw relay URL) verbatim. A different string for the same relay caused a cache miss, treating the community as never-provisioned and triggering re-provisioning. 2. isAgentScopedToRelay in welcomeGuide.ts used a local normalizeRelayUrl that only trimmed and stripped trailing slashes — it did not lowercase the scheme or host. An existing agent stamped with one string was invisible to a lookup using a different but logically identical string. Both now use the shared normalizeRelayUrl from shared/lib/normalizeRelayUrl which trims, strips trailing slashes, and lowercases — the same normalizer used by every other relay-scoped local store (sidebar, channel sort, message snapshots, self-profile). Closes block#5109. Co-authored-by: Brad Groux <brad@digitalmeld.com> Signed-off-by: Brad Groux <brad@digitalmeld.com> Signed-off-by: dm-builder <f01486f036641ccb52c11bb1e0ff2346ea89a8b4e3b49cd772249948f6fcbae6@digitalmeld.communities.buzz.xyz>
Co-authored-by: Brad Groux <bradgroux@hotmail.com> Signed-off-by: Brad Groux <bradgroux@hotmail.com>
582fb63 to
cc288a9
Compare
|
Portfolio rebase and review update (2026-08-11) Rebased onto Still needed: The relay URL canonicalization bug in welcome team scoping is still present. The onboarding polish in #5310 and the Welcome banner fixes in #5406 and #5330 did not touch Verification: |
Summary
Changing only the formatting of a community Relay URL could cause the Desktop onboarding path to miss the existing Welcome Team and provision another one. The affected comparisons now use the shared relay URL normalizer, so scheme/host case and trailing-slash variants reuse the existing community-scoped state.
The change also migrates the exact legacy
localStoragemarker to its canonical key when it is first read. That prevents an existing installation from taking one final duplicate-provisioning path after upgrading. Starter-agent matching coverage now verifies that relay formatting variants still reuse the same deployed instance.Related issue
Addresses the formatting-only subset of #5109.
This does not claim that
localhost, a LAN or Tailscale IP, and a MagicDNS hostname identify the same relay. Those are distinct endpoint strings and cannot be safely collapsed by URL normalization alone. It also does not remove already-stale agent records or change the mobile agent picker, so #5109 should remain open for those broader cases.Testing