Skip to content

Commit a9216c3

Browse files
committed
fix(data): restart sweep timer when a dropped replica is re-added
When the last (or only) tab is dropped by sweep and the timer stops, a resumed tab re-added through the handle() path only updated heard without restarting the sweep timer. This left loss detection permanently disabled after the first recovery. Replace the bare heard.set() with watch(), which does the same timestamp update and also ensures the sweep timer is running via sweeping ??=.
1 parent 8455a84 commit a9216c3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/octane/src/data/owner.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export function createDataOwner(options: {
404404
dropped.delete(port);
405405
replicas.add(port);
406406
}
407-
heard.set(port, hostDateNow());
407+
watch(port);
408408
if (message.t === 'request') request(port, message.id, message.request, message.fresh);
409409
else if (message.t === 'listen') subscribe(port, message.id, message.request);
410410
else if (message.t === 'unlisten') unsubscribe(port, message.id);

0 commit comments

Comments
 (0)