mirror of
https://github.com/block/buzz.git
synced 2026-10-29 05:21:31 +00:00
fix(sidebar-sync): use hold bootstrap in P3 restart test; remote head drives merge at doPublish not bootstrap
Bootstrap fetch returns [] (hold) so publishStars is called unconditionally — the subsumed guard only runs on apply-remote, which would require extra async ticks to verify. The 501-entry merge still exercises at the production seam: when the 2s debounce fires and doPublish calls fetchRemoteStars (fetchCalls=2), the 500-entry remote head triggers mergeWithRemote producing 501 entries. Without preservedKey forwarded from the foreign record, boundStarStore evicts the clicked channel there. The test structure now matches the existing bootstrap replay test (hold bootstrap → timer fires → publish cycle exercises the production path). Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
@@ -660,9 +660,14 @@ export function runMergeLaneHookSuite({
|
||||
|
||||
const publishCalls = [];
|
||||
let fetchCalls = 0;
|
||||
// Bootstrap fetch returns hold (empty) so publishStars is always called
|
||||
// unconditionally — the subsumed guard only suppresses on apply-remote.
|
||||
// The per-publish mergeWithRemote fetch (fetchCalls === 2) returns the
|
||||
// 500-entry remote head, triggering the 501-entry merge that evicts the
|
||||
// clicked channel without preservedKey.
|
||||
relayClient.fetchEvents = async () => {
|
||||
fetchCalls++;
|
||||
return fetchCalls === 1 ? [remoteHead] : [];
|
||||
return fetchCalls === 2 ? [remoteHead] : [];
|
||||
};
|
||||
relayClient.publishEvent = async (evt) => {
|
||||
publishCalls.push(evt);
|
||||
|
||||
Reference in New Issue
Block a user