Skip to content

A relay that has answered nothing cannot be asked for the last hour - #204

Merged
sepehr-safari merged 1 commit into
mainfrom
a-new-relay-has-not-answered-yet
Aug 11, 2026
Merged

A relay that has answered nothing cannot be asked for the last hour#204
sepehr-safari merged 1 commit into
mainfrom
a-new-relay-has-not-answered-yet

Conversation

@sepehr-safari

Copy link
Copy Markdown
Contributor

#197 dials relays the reader is not on, chosen because the people they follow write there, and asks each about exactly those people. It asked them with a since, and that made the whole feature deliver almost nothing. Shipped an hour ago in v0.3.0.

feedSince is the newest note I hold, minus an hour. On the pool's own relays that is correct: they have been answering this same question all along, so anything older is already in the store, and the bound is what stops every reconnect re-downloading the backlog.

A routed relay has answered nothing. It was dialled precisely because it holds notes from people whose posts the reader has never had, and every one of those is older than the newest note the reader holds from anybody else. So the bound asked a relay full of missing history for the last hour of it.

Amethyst hit this from the other side and wrote it down: a since floor "silently emptied the tab" on a cold start.

Routed subscriptions get their own builder now, so the two questions cannot be conflated again by editing one call site, and the reasoning sits at the top of it.

Live, before and after

Same account, same relays. With the bound: effectively nothing. Without it, three routed relays asked about 29, 22 and 18 people delivered more than six hundred notes in a hundred seconds.

The test needed a second try, which is the more useful half

The first version passed with the bug still in. feedSince returns null when the feed holds no note at all, which is the case in every test, so it was asserting "no since" against code that could not have produced one. Removing the fix failed nothing.

It now stamps a newest note first and asserts feedSince is non-null before asserting the filters do not carry it, so the fix is what makes it pass. Verified by putting the bug back and watching it go red.

That is the third time today a test of mine passed for the wrong reason, and the second where the tell was "the probe failed nothing".

#197 dials relays the reader is not on, chosen because the people they
follow write there, and asks each about exactly those people. It asked
them with a `since`, and that made the whole feature deliver almost
nothing. Shipped an hour ago in v0.3.0.

`feedSince` is "the newest note I hold, minus an hour". On the pool's own
relays that is right: they have been answering this same question all
along, so anything older is already in the store, and the bound is what
stops every reconnect re-downloading the backlog.

A routed relay has answered nothing. It was dialled precisely because it
holds notes from people whose posts the reader has never had, and every
one of those is older than the newest note the reader holds from anybody
else. So the bound asked a relay full of missing history for the last hour
of it.

Amethyst hit this from the other side and wrote it down: a `since` floor
"silently emptied the tab" on a cold start.

Routed subscriptions are built by their own function now, so the two
questions cannot be conflated again by editing one call site, and the
reason is at the top of it.

Live, on my own account, before and after: with the bound, effectively
nothing. Without it, three routed relays asked about 29, 22 and 18 people
delivered more than six hundred notes in a hundred seconds.

The test needed a second try and that is the more useful half of this. The
first version passed with the bug still in, because `feedSince` returns
null when the feed holds no note at all, which is every test. It asserted
"no since" against code that could not have produced one. It stamps a
newest note first now, and asserts `feedSince` is non-null before
asserting the filters do not carry it, so the fix is what makes it pass.
Verified by putting the bug back and watching it fail.
@sepehr-safari
sepehr-safari merged commit 7197ccd into main Aug 11, 2026
2 checks passed
@sepehr-safari
sepehr-safari deleted the a-new-relay-has-not-answered-yet branch August 11, 2026 23:05
@sepehr-safari sepehr-safari mentioned this pull request Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant