fix(call-to-play): explain peer startup state
Treat an unavailable actor ID or an explicit not-ready result as normal peer startup and tell the user that LAN connection is still in progress. Clear that message when snapshot registration succeeds. Map obsolete, missing-history, and active-history-limit store failures to distinct guidance without marking a healthy transport unavailable. Preserve a generic message for unexpected publish failures. Test Plan: - just frontend-test - just build - git diff --cached --check
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import {
|
||||
CALL_TO_PLAY_CONNECTING_MESSAGE,
|
||||
CHECKIN_LEAD_MS,
|
||||
EXPIRED_RETENTION_MS,
|
||||
TERMINAL_RETENTION_MS,
|
||||
activeCallCount,
|
||||
callToPlayPublishErrorMessage,
|
||||
extendDeadline,
|
||||
phaseOf,
|
||||
bumpTime,
|
||||
@@ -178,6 +180,34 @@ Deno.test('adding time extends from the current deadline or the current time', (
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test('publish failures distinguish startup and store outcomes', () => {
|
||||
assertEquals(
|
||||
CALL_TO_PLAY_CONNECTING_MESSAGE,
|
||||
'Call to Play is still connecting to the LAN. Try again in a moment.',
|
||||
'peer startup message',
|
||||
);
|
||||
assertEquals(
|
||||
callToPlayPublishErrorMessage('Call to Play event is obsolete'),
|
||||
'This Call to Play has expired or already finished.',
|
||||
'obsolete call message',
|
||||
);
|
||||
assertEquals(
|
||||
callToPlayPublishErrorMessage('Call to Play history is missing'),
|
||||
'This Call to Play has expired or already finished.',
|
||||
'missing expired history message',
|
||||
);
|
||||
assertEquals(
|
||||
callToPlayPublishErrorMessage(new Error('Call to Play event history is full')),
|
||||
'Call to Play has reached its active update limit. Start or cancel an active call, then try again.',
|
||||
'active history limit message',
|
||||
);
|
||||
assertEquals(
|
||||
callToPlayPublishErrorMessage('channel closed'),
|
||||
'Could not send this Call to Play update.',
|
||||
'unexpected failure message',
|
||||
);
|
||||
});
|
||||
|
||||
Deno.test('reduction is order-independent and deduplicates events and messages', () => {
|
||||
const message = event('message-event', 'Bob', {
|
||||
SendMessage: { message_id: 'message-1', text: 'Ready?' },
|
||||
|
||||
Reference in New Issue
Block a user