Repository navigation
20260923 - Offer the claim address again after a release - #22
Merged
Merged
Conversation
Reported on jonathan-node-1 (ClickUp 123zgec4mb1): claimed, released from the dashboard, and then neither Save nor Send again produced a link. A release clears the address on the server as well as the owner, unlike a declined link, which keeps it. The node learnt of the release within a minute through the heartbeat, but chose its call by comparing the file's address with the one it last sent. That still matched, so Save counted as no change and sent nothing, and Send again became a resend, which mails only the address on file and so mailed nothing. The node now remembers the address the server last said it holds. When that goes from an address to null, the last offer is forgotten and the address is offered again on the next tick. Only the transition resets it: an address the server refused was never held, so it stays null throughout and is not re-offered every tick for the same 400. The mock gains release(), which does what production did on jn1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The previous commit noticed a release by watching the server's address go from set to null, but only sampled it at the start of each claim tick. A release that reached the node before the tick after the PUT, by heartbeat, therefore looked like an address that was never held, and the node stayed silent. test_a_released_node_offers_its_address_again failed 23 runs in 40 locally and failed in CI on #22. A 200 from PUT /nodes/claim is itself proof the server holds the address, so it is recorded there. 60 runs in 60 now pass. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The first two commits re-offered the address as soon as the node noticed a release, which mailed the previous owner a link to take the node back within a minute of giving it up. That is wrong for an owner who released the node to hand it on, and the ticket only ever needed the link to arrive when asked. Nothing is sent on a release now. The address stays in retina-gui's file and does not count as a change. The decision moves to the moment the owner presses Send again: if the server holds no address, which is what a release leaves, a resend would mail nothing, so the ask is answered with a PUT. Otherwise it is a resend, as before. This also retires the set-to-null tracking and the race the second commit fixed in it, since nothing watches for the transition any more. Save with an unchanged address still sends nothing after a release. retina-gui writes an identical file for it, so the node cannot see it. Send again, or a different address, are the two ways to ask. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
retina-gui#96 replaces Save and Send again with one Send link button, and every press now writes the address and a fresh send_requested_at. The docstrings, data-sources.md and CLAUDE.md still described the two buttons, so they are brought up to date. No logic changes: the node already handles an address with a stamp beside it, and an address with none, which an older retina-gui or a hand edit still produces, stays valid. data-sources.md and CLAUDE.md also gain the release behaviour this branch was written for: a release clears the address where a decline keeps it, and nothing is sent on a release by itself. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Fixes a node that could not be claimed again after its owner released it. (Unclaim & Reclaim Fail)
What happened on jonathan-node-1
Claimed at 13:04, owned at 13:05, released from the dashboard at 13:51. After that neither Save nor Send again on the retina-gui claim page produced a link.
A release clears the address on the server as well as the owner. A declined link does not: it leaves the address on file, which is the case #21 was built and verified around. The node heard about the release within a minute through the heartbeat (
claim.email: nullin its status document), but:POST /nodes/claim/resend, which the spec says mails "the address already on file". There was none, so nothing was mailed.The fix
Send again on a node the server holds no address for is answered with
PUT /nodes/claimrather than a resend.PUTis the call that mails. Where the server does hold an address (a declined link, a pending one) Send again is still a resend, exactly as before.Nothing is sent on a release by itself. The owner may have released the node to hand it on, so mailing them a link to take it back unasked would be wrong. The address stays in retina-gui's file after a release and does not count as a change.
The mock gains
release(), which does what production did on jn1.Reading the commits
The branch took three goes, and the last one replaces most of the first two, so review the combined diff rather than commit by commit.
5402f85re-offered the address as soon as the node saw a release.0d11eaefixed a race in that, found by CI: the release could land before the node had noticed the address was held.9d9f58amoves the decision to the owner's ask instead, so nothing is mailed unasked. This removes the tracking the first two added, and the race with it.data-sources.mdandCLAUDE.mdfor retina-gui#96's single button, and records the release behaviour. Wording only.Worth a look
PUTfails is recorded as acted on, like a failed resend, so it is left for the owner to press again rather than repeated.Verification
tools/check.shandtools/check.sh --trackedpass.test_a_released_node_is_left_alone_until_asked: after a release, no call for several heartbeats and ticks.test_an_ask_on_a_released_node_offers_the_address: Send again after a release sends onePUT, and no resend. It fails without the change to__main__.py.🤖 Generated with Claude Code