Commit Graph

3 Commits (99462454d0ccecbf2e27dc8a07e56981b329daa6)

Author SHA1 Message Date
Ashley 2099fa6593 Keep a populated home feed when a forced warm publishes nothing
A forced warm that came up with no publishable candidates deleted the
live feed key. For a per-user feed that is destructive in exactly the
wrong direction: the warm can come up empty because the viewer's cached
following list is stale or because the statuses behind the candidates
could not be resolved, and the user who was reading their timeline a
moment ago is left with nothing. The scratch key is dropped instead and
the live feed is untouched. The instance-wide feeds keep their
clear-on-empty behaviour, which now has a comment saying why they differ.

warmCache also returns the number of members it published instead of a
constant 1, which is what lets a caller tell "rebuilt and ready" from
"nothing to show". The unused $returnIds parameter is gone; all four
call sites discarded it.

Verified standalone off staging:
HomeWarmEmptyResultTest 2 passed; HomeChronologicalOrderTest green;
tests/Feature/Timeline + HomeFeed 73 passed.
7 days ago
Ashley 0c89464d5c Fix static analysis warning and align timeline tests with live-feed fanout
Drop an always-true empty() guard on the home feed Link header that static
analysis flagged as redundant.

Update the fanout and follow-backfill tests to seed a live home feed before
dispatching, since fanout now only appends to feeds that already exist and
skips idle ones. Switch the network null-account test to a real sorted set
instead of a Redis spy so the cached read path actually runs, and force a
deterministic id in the chronological ordering test so it no longer depends
on sub-millisecond insert timing.
2 weeks ago
Ashley 1012a376e8 Score cached timelines by created_at instead of status id
The home, local and network sorted sets scored entries by status id and
read them highest-id-first. For remote posts the local id reflects ingest
time, not publish time, so a recently federated but older post sorted to
the top of the home and network feeds while genuinely newer posts fell
below or were trimmed out. Local-only feeds looked correct only because
snowflake ids track creation time there.

Score every entry by its created_at timestamp, keep the status id as the
member, and translate the id-based min_id/max_id cursors to their stored
score so pagination still works against the Mastodon id cursors. Warming
scores the same way so a rebuilt feed is consistent with live inserts.
2 weeks ago