Fix relay count display: emit broadcastProgress done event for all publishes (not just broadcasts), add missing eventId/eventKind to broadcast done event

This commit is contained in:
Laan Tungir
2026-06-30 09:33:08 -04:00
parent 456f0e1f2e
commit a20b28cd21
2 changed files with 23 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
{
"VERSION": "v0.7.70",
"VERSION_NUMBER": "0.7.70",
"BUILD_DATE": "2026-06-30T13:28:38.113Z"
"VERSION": "v0.7.71",
"VERSION_NUMBER": "0.7.71",
"BUILD_DATE": "2026-06-30T13:33:08.793Z"
}

View File

@@ -6308,6 +6308,8 @@ async function handlePublish(requestId, event, port) {
broadcast({
type: 'broadcastProgress',
sessionId: publishSessionId,
eventId: ndkEvent.id || null,
eventKind: event.kind,
phase: 'done',
total: totalTarget,
successful: publishedSoFar.size,
@@ -6323,6 +6325,24 @@ async function handlePublish(requestId, event, port) {
}
}
// For non-broadcast publishes, emit a simplified broadcastProgress 'done'
// event so post cards can still show the relay count (e.g., "3r - 1h").
// We use the relaySet result to count successful relays.
if (!isBroadcast) {
const successCount = relaySet ? relaySet.size : 0;
broadcast({
type: 'broadcastProgress',
sessionId: publishSessionId,
eventId: ndkEvent.id || null,
eventKind: event.kind,
phase: 'done',
total: successCount,
successful: successCount,
failed: 0,
latestRelay: null,
});
}
// Get detailed relay results
const relayResults = {
successful: [],