From ef1739e2de914f0a02990979f13057cef77c9a44 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 26 Oct 2026 08:35:54 -0700 Subject: A released placeholder address on your profile page shows as the claimed one on the Lightning line too, and Save in the profile editor repoints it in the kind 0 (a same-domain name that no longer answers); the background heal steps aside for an interactive signer (Amber) instead of waiting forever in the kind-0 queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Jarryd's page still showed jarryd@coinos.io over ⚔ jar@coinos.io: the header only substituted the NIP-05 line, and his kind 0 was never republished — the heal of ce96364 needs a background signature, which an Amber sign-in can't give, and Save left a lud16 that wasn't the old address alone. Co-Authored-By: Claude Fable 5.1 --- tools/profile-publish-race-test.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/profile-publish-race-test.js b/tools/profile-publish-race-test.js index 390c01b..becf375 100644 --- a/tools/profile-publish-race-test.js +++ b/tools/profile-publish-race-test.js @@ -67,9 +67,10 @@ const wallet = { loadFeatureState: () => null, saveFeatureState: () => {}, _cacheKey: () => 'race-test', saveCache: () => {}, registerCacheExtension: () => {}, registerLoadHook: () => {}, }; +let namesAddr = null; // what the registrar says our address is const feature = messagesFeature({ h: (tag, attrs, ...kids) => ({ tag, attrs, kids }), ui: {}, render: () => {}, wallet, toast: () => {}, brandHeader: () => null, - hook: (name) => (name === 'nostrLoginIdentity' ? { pubkey: pk, signer } : null), + hook: (name) => (name === 'nostrLoginIdentity' ? { pubkey: pk, signer } : name === 'namesAddress' ? namesAddr : null), }); console.log('[the migration: rename and avatar import fired together]'); @@ -91,5 +92,20 @@ await Promise.all([feature.addressRenamed('jarryd@coinos.io', 'jaz@coinos.io'), const last = JSON.parse(store.filter((e) => e.kind === 0 && e.pubkey === pk).sort((a, b) => b.created_at - a.created_at)[0].content); check('both changes survive', last.lud16 === 'jaz@coinos.io' && last.about === 'hi' && /face/.test(last.picture), JSON.stringify(last)); +console.log('[Save in the editor repoints a dead same-domain address]'); +// The heal never ran (an Amber user: no background signatures), so the kind 0 +// still names the released placeholder. The domain says jar is dead, other +// is alive. +store.push(finalizeEvent({ kind: 0, created_at: now + 1000, tags: [], content: JSON.stringify({ name: 'Jarryd', lud16: 'jar@coinos.io', nip05: 'other@coinos.io' }) }, sk)); +namesAddr = 'jarryd@coinos.io'; +globalThis.fetch = async (url) => /lnurlp\/jar$/.test(url) + ? { ok: false, status: 500, json: async () => null } + : { ok: true, status: 200, json: async () => ({ tag: 'payRequest', callback: 'https://x/cb' }) }; +published.length = 0; +await feature.saveProfileDraft({ uname: 'jarryd', name: 'Jarryd' }); +const saved = JSON.parse(published.filter((e) => e.kind === 0).pop().content); +check('the dead placeholder moves to the claimed address', saved.lud16 === 'jarryd@coinos.io', JSON.stringify(saved)); +check('a same-domain address that still answers is left alone', saved.nip05 === 'other@coinos.io', saved.nip05); + console.log(fails ? `\nāŒ ${fails} failing` : '\nāœ… kind-0 publishes take turns'); process.exit(fails ? 1 : 0); -- cgit v1.2.3