Compare commits

...
2 Commits
2 changed files with 19 additions and 6 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
{
"VERSION": "v0.7.82",
"VERSION_NUMBER": "0.7.82",
"BUILD_DATE": "2026-06-30T15:07:27.716Z"
"VERSION": "v0.7.84",
"VERSION_NUMBER": "0.7.84",
"BUILD_DATE": "2026-06-30T15:36:36.887Z"
}
+16 -3
View File
@@ -6215,6 +6215,9 @@ async function handlePublish(requestId, event, port) {
// Track current batch for progress display. Updated by the batch loop.
let currentBatch = 0;
let totalBatches = 0;
// Debug: track publish start time for timing analysis (defined in outer
// scope so the batch loop and silent-failure detection can access it).
const publishStartTime = Date.now();
if (isBroadcast && totalTarget > 0) {
console.log(`[Worker] Broadcasting to ${allBroadcastUrls.length} relays ` +
@@ -6233,9 +6236,6 @@ async function handlePublish(requestId, event, port) {
latestRelay: null,
});
// Debug: track publish start time for timing analysis
const publishStartTime = Date.now();
ndkEvent.on('relay:published', (relay) => {
const url = relay?.url || String(relay || '');
if (!url) return;
@@ -6373,6 +6373,19 @@ async function handlePublish(requestId, event, port) {
} catch (batchErr) {
// Expected — some relays in this batch may fail.
}
// --- Detect silent failures ---
// NDK's relay.publish() can resolve false without emitting
// relay:publish:failed (e.g., DNS errors, connection refused,
// HTTP handshake failures). These relays are not in any of
// our tracked sets. Mark them as timed out so they get
// skip-marked and don't waste time on the next publish.
for (const url of batch) {
if (!publishedSoFar.has(url) && !failedSoFar.has(url) && !timedOutSoFar.has(url)) {
timedOutSoFar.add(url);
const elapsed = ((Date.now() - publishStartTime) / 1000).toFixed(1);
console.log(`[Worker][broadcast] ⏱️ ${url} SILENT TIMEOUT (${elapsed}s) — batch ${currentBatch}/${totalBatches} (no response, likely connection failure)`);
}
}
// Emit a progress event with batch info after each batch.
broadcast({
type: 'broadcastProgress',