| … | … | @@ -478,17 +478,33 @@ export async function bootSwarmDevice ({ storage, deviceMnemonic, did, signingKe |
| 478 | 478 | |
| 479 | 479 | let ticking = false |
| 480 | 480 | let tickAgain = false |
| 481 | // ⛔ A SWALLOWED TICK IS INVISIBLE. 2026-10-14: loser-club's elected signer (stortron, holdsSigner true, |
| 482 | // running the fixed atproto-room) never re-signed its two ver-less member labels, and nothing anywhere said |
| 483 | // why — this catch ate whatever sign() or the label tick threw. Log it (once per distinct message, so an |
| 484 | // event storm cannot flood the log), and log when the label room signs, so the next restart is evidence. |
| 485 | let lastTickError = null |
| 481 | 486 | const tick = async () => { |
| 482 | 487 | if (ticking) { tickAgain = true; return } // coalesce bursts; re-run once if one arrived mid-flight |
| 483 | 488 | ticking = true |
| 489 | let step = 'admit' |
| 484 | 490 | try { |
| 485 | 491 | if (sb.base && !sb.base.writable) { try { await sb.ensureAdmitted() } catch {} } |
| 486 | 492 | reconcile() // deliberately NOT awaited — byte convergence must not gate signing (or vice versa) |
| 493 | step = 'sign' |
| 487 | 494 | await device.sign() |
| 488 | | if (labelRoom) await labelRoom.tick() |
| 495 | if (labelRoom) { |
| 496 | step = 'labels' |
| 497 | const signed = await labelRoom.tick() |
| 498 | if (signed > 0) console.log(JSON.stringify({ msg: 'labels: signed', did: device.did, count: signed })) |
| 499 | } |
| 500 | step = 'project' |
| 489 | 501 | if (membraneServing) { await membraneServing.sync(); await membraneServing.syncLabels() } |
| 490 | | } catch {} |
| 491 | | finally { ticking = false; if (tickAgain) { tickAgain = false; tick() } } |
| 502 | lastTickError = null |
| 503 | } catch (err) { |
| 504 | const m = step + ': ' + ((err && err.message) || String(err)) |
| 505 | if (m !== lastTickError) console.error(JSON.stringify({ msg: 'tick failed', did: device.did, step, error: (err && err.message) || String(err) })) |
| 506 | lastTickError = m |
| 507 | } finally { ticking = false; if (tickAgain) { tickAgain = false; tick() } } |
| 492 | 508 | } |
| 493 | 509 | let unwatch = null |
| 494 | 510 | if (signIntervalMs > 0) { // >0 = enable the (now event-driven) sign loop; 0 = disabled (tests drive sign() manually) |