Skip to content

fix: sync in-memory publication URL after custom domain changes#238

Closed
zzstoatzz wants to merge 1 commit into
flo-bit:mainfrom
zzstoatzz:fix/publication-url-custom-domain
Closed

fix: sync in-memory publication URL after custom domain changes#238
zzstoatzz wants to merge 1 commit into
flo-bit:mainfrom
zzstoatzz:fix/publication-url-custom-domain

Conversation

@zzstoatzz

@zzstoatzz zzstoatzz commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

problem

when a user sets up a custom domain via the CustomDomainModal, the URL is correctly written to ATProto (site.standard.publication record), but the in-memory data.publication.url is never updated. this causes a subtle bug:

  1. user verifies custom domain → ATProto record gets url: "https://mycustomdomain.com"
  2. user edits their site and saves → savePage() runs
  3. savePage() checks if (!data.publication.url) — but the old blento.app/{handle} URL is still in memory, so this guard is truthy
  4. the stale blento.app/{handle} URL gets written back to ATProto, overwriting the custom domain URL

the same issue exists in reverse when removing a custom domain — the URL field is stripped from ATProto but stays in memory.

impact

downstream consumers that index site.standard.publication records end up storing the wrong URL. for example, a document at https://marcobonomo.dev/blog/manifesto-cucina-amatoriale gets indexed with https://blento.app/marcobonomo.dev/blog/manifesto-cucina-amatoriale, which 404s.

found via https://pub-search.waow.tech/?q=%22in+una+libreria%22

fix

add an onUrlChange callback prop to CustomDomainModal. after verify() succeeds, it calls back with the new https://{domain} URL. after removeDomain() succeeds, it calls back with undefined. Account.svelte wires this up to update data.publication.url in place.

changes

  • CustomDomainModal.svelte: add onUrlChange prop, call it after verify and remove
  • Account.svelte: pass onUrlChange callback to sync data.publication.url

@zzstoatzz zzstoatzz force-pushed the fix/publication-url-custom-domain branch 2 times, most recently from e0aed13 to 25c86c7 Compare March 2, 2026 02:42
@zzstoatzz

zzstoatzz commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

the LinkCardSettings.svelte changes are just prettier-plugin-tailwindcss reordering class names into canonical order to get CI green (lmk if im wrong and this wasn't preexisting)

When a user verifies or removes a custom domain, the URL is written to
ATProto but the in-memory data.publication.url is not updated. Subsequent
savePage calls then overwrite the custom domain URL with the stale
blento.app/{handle} fallback, because the `if (!data.publication.url)`
guard sees the old value as truthy and skips setting the new one.

This causes downstream consumers (like search engines indexing
site.standard.publication records) to store the wrong URL, leading to
broken links in search results.

Add an onUrlChange callback prop to CustomDomainModal that updates the
in-memory state after verify/remove operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zzstoatzz zzstoatzz force-pushed the fix/publication-url-custom-domain branch from 25c86c7 to 39aa5b0 Compare March 2, 2026 02:45
@zzstoatzz zzstoatzz marked this pull request as ready for review March 2, 2026 02:48
@zzstoatzz zzstoatzz closed this Mar 2, 2026
@zzstoatzz zzstoatzz deleted the fix/publication-url-custom-domain branch March 2, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant