Repository navigation
01a10c6e - Keep a reply gift separate from sats received on it - #407
Conversation
A reply keeps the amount sent with it in sats. Later zaps and a spend proof on that reply credit receivedSats and the received fiat columns. Top-level notes stay on sats and omit the new JSON keys. Boot moves indexed zap-receipt sums off reply sats once, and does not read spend invoices.
|
dfx pr guard EN: Thanks for your contribution! This repository follows A38. A38 pass: author local-CI report not required because the author has write on this repository. DE: Danke für deinen Beitrag! In diesem Repository gilt A38. A38 pass: Autor-Local-CI-Report nicht erforderlich, weil der Autor Write auf diesem Repository hat. Details
|
The handbook still said a zap on a reply credits sats and that the long-poll only waits on sats.
|
EN: DE: DetailsHead: Lane Final result: {
"schema": "a38-review/v2",
"head": "934e1008c9f5211d827b54355685c587f7fea8b1",
"passes": 1,
"defects": 0,
"set_aside": "none",
"lanes": [
{"id": "conformity-a", "result": "pass", "status": "complete", "provider": "grok", "model": "grok-4.6", "model_number": "grok-4.6", "prompt": "Review the complete PR diff for conformity with CONTRIBUTING.md."},
{"id": "logic-a", "result": "pass", "status": "complete", "provider": "grok", "model": "grok-4.6", "model_number": "grok-4.6", "prompt": "Review the complete PR diff for logical correctness."}
]
}One review pass. Conformity and logic both finished with no defects on this head. Checks on this head were already green, and GitHub reports the pull request mergeable. |
|
EN: DE: Details{
"base": "316d4fb2b04008628458c62c8aacc91ed4fda47c",
"head": "934e1008c9f5211d827b54355685c587f7fea8b1",
"phase": "applied",
"pr": 407,
"reasons": [],
"repo": "21gifts/api",
"state": "ready"
} |
|
EN: DE: DetailsHead: The first review pass stands: no defects. This second pass does not change that result and does not take the pull request back to draft. One point remains for a human to decide. In |
EN:
A reply keeps the gift sent with it in
sats, and later payments on that reply land inreceivedSatsinstead of being added to the same number.Top-level notes are unchanged:
satsstays the collected total, and the new keys are omitted.On boot, indexed zap receipts are moved off a reply's
satsonce; spend invoices that never became a receipt stay where they are.An older app still reads only
sats, so it shows the sent gift again and does not show the received amount, and its pay sheet on an existing reply waits onsatsuntil the app pollssinceReceivedSats.DE:
Eine Antwort behält das mitgeschickte Geschenk in
sats. Spätere Zahlungen auf diese Antwort landen inreceivedSatsund werden nicht mehr zur selben Zahl addiert.Notizen auf oberster Ebene bleiben unverändert:
satsist weiter die Summe, die neuen Schlüssel fehlen.Beim Start werden indexierte Zap-Belege einmal von
satseiner Antwort abgezogen. Spend-Belege, die nie ein Zap-Receipt wurden, bleiben stehen.Eine ältere App liest nur
sats, zeigt also wieder das gesendete Geschenk und nicht den empfangenen Betrag. Ihr Zahlungsblatt auf einer bestehenden Antwort wartet aufsats, bis die AppsinceReceivedSatsabfragt.Details
satson a reply is the amount the author sent with that reply.receivedSatsandreceivedAmountUsd,receivedAmountChf,receivedAmountEur, andreceivedAmountPhpare later zaps and spend proofs on that reply. Those credits do not changesats, the sent fiat columns, orgoal_funded_at.A zap receipt joined on
message_idcreditssatswhenparent_idis null, andreceived_satswhenparent_idis set. A second proof of the same invoice still credits once. A proof on a reply still hides the platform marker and does not create a nested visible reply.GET /messages/:id?sinceReceivedSats=accepts only a non-negative integer. On a live reply it long-polls untilreceivedSatsis greater. A top-level note ignores the parameter. If bothsinceSatsandsinceReceivedSatsare set, the poll waits until both have moved. A hidden moderator read still returns immediately.The boot repair runs only where
received_satsis null. It setsreceived_satsfrom the sum ofnostr_zap_receipton that reply and subtracts that sum fromsats, floored at 0. Received fiat is filled, and subtracted from the sent fiat columns, only when every receipt has a non-null indexed ingest amount for that currency. It does not readmessage_invoiceand it does not use deleted child rows. Replies with no receipt getreceived_sats0. The repair does not run again after the column is not null.The query window for ingest is unchanged.