<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coinos-server.git/scripts/dedup-invoices.ts, branch staging</title>
<subtitle>coinos server — legacy coinos.io backend (Lightning, on-chain, Liquid)</subtitle>
<id>https://git.coinos.io/coinos-server.git/atom?h=staging</id>
<link rel='self' href='https://git.coinos.io/coinos-server.git/atom?h=staging'/>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/'/>
<updated>2026-06-18T14:43:48Z</updated>
<entry>
<title>invoices: don't re-list an invoice id on update (dedupe :invoices)</title>
<updated>2026-06-18T14:43:48Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2026-06-18T14:43:48Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=64691693e7ff40aae59b05a234f88025757959e3'/>
<id>urn:sha1:64691693e7ff40aae59b05a234f88025757959e3</id>
<content type='text'>
Port of the master fix (2d2f9856) + cleanup script to staging.

generate() unconditionally lPush'd the invoice id to `${aid}:invoices`,
but it's also called from update() (tip/webhook changes, repeated bolt12
offer creation) re-using the existing id — so each update re-appended the
same id and the user's :invoices accumulated duplicate entries, rendering
the same offer/invoice multiple times. Guard the push with LPOS so it only
adds the id the first time.

Also add scripts/dedup-invoices.ts to scrub already-accumulated dupes
(dry-run by default, --apply to write, idempotent).

Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
