fix: sync in-memory publication URL after custom domain changes#238
Closed
zzstoatzz wants to merge 1 commit into
Closed
fix: sync in-memory publication URL after custom domain changes#238zzstoatzz wants to merge 1 commit into
zzstoatzz wants to merge 1 commit into
Conversation
e0aed13 to
25c86c7
Compare
Contributor
Author
|
the |
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>
25c86c7 to
39aa5b0
Compare
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.
problem
when a user sets up a custom domain via the CustomDomainModal, the URL is correctly written to ATProto (
site.standard.publicationrecord), but the in-memorydata.publication.urlis never updated. this causes a subtle bug:url: "https://mycustomdomain.com"savePage()runssavePage()checksif (!data.publication.url)— but the oldblento.app/{handle}URL is still in memory, so this guard is truthyblento.app/{handle}URL gets written back to ATProto, overwriting the custom domain URLthe 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.publicationrecords end up storing the wrong URL. for example, a document athttps://marcobonomo.dev/blog/manifesto-cucina-amatorialegets indexed withhttps://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
onUrlChangecallback prop toCustomDomainModal. afterverify()succeeds, it calls back with the newhttps://{domain}URL. afterremoveDomain()succeeds, it calls back withundefined.Account.sveltewires this up to updatedata.publication.urlin place.changes
CustomDomainModal.svelte: addonUrlChangeprop, call it after verify and removeAccount.svelte: passonUrlChangecallback to syncdata.publication.url