Skip to content

feat(pwa): support asymmetric no-reply conversation flows - #98

Merged
efischer19 merged 9 commits into
mainfrom
copilot/feat-pwa-decouple-message-lock
Jul 28, 2026
Merged

feat(pwa): support asymmetric no-reply conversation flows#98
efischer19 merged 9 commits into
mainfrom
copilot/feat-pwa-decouple-message-lock

Conversation

Copilot AI commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

The PWA assumed a strict request/reply cadence and kept user messages pending until a bot reply appeared. This change decouples delivery state from reply rendering so ack-only, empty-body, and timeout paths resolve cleanly without blocking follow-up sends or rendering empty assistant bubbles.

  • Polling + acknowledgement handling

    • Treats explicit ack-style payloads (reply: null or status in the acknowledgement set) as processed when no newer reply exists.
    • Accepts empty response bodies in polling/response fetches and resolves the pending user message without requiring a bot bubble.
    • Preserves the existing “newer reply available” path so mixed ack/reply payloads still render the reply.
  • Message lifecycle

    • Marks user messages as Sent immediately after the message POST succeeds.
    • Resolves no-reply/processed outcomes as Read.
    • Resolves polling timeout outcomes as Delivered, separating transport success from bot reply generation.
  • Empty bubble prevention

    • Normalizes blank / whitespace-only transcripts to “no content”.
    • Skips assistant message insertion when neither transcript nor audio is present.
  • Regression coverage

    • Adds focused frontend tests for:
      • ack-only status payloads
      • empty/no-reply response payloads
      • timeout-to-delivered transitions
      • threaded follow-up replies continuing to render correctly
if (isAcknowledgementOnlyPayload(payload) && !hasNewResponse) {
  resolvePendingConversation(conversation, elements, state, MESSAGE_STATUS_READ);
  return { nextDelayMs: normalizePollDelay(statusPayload.cacheTtlSeconds) };
}

Final Checklist

  • ADR Compliance: This PR adheres to all Accepted ADRs.
    • ADR-005: Poll Cloudflare Worker for response status instead of S3 directly
    • ADR-002: Use SQS long polling instead of WebSockets
  • All Definition of Done criteria from the linked issue have been met.

Copilot AI changed the title [WIP] Decouple 1:1 message lock to support asymmetric conversation flows feat(pwa): support asymmetric no-reply conversation flows Jul 26, 2026
Copilot AI requested a review from efischer19 July 26, 2026 22:13
@efischer19
efischer19 marked this pull request as ready for review July 28, 2026 01:30
@efischer19
efischer19 merged commit 05a0dff into main Jul 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(pwa): decouple 1:1 message lock to support asymmetric conversation flows

2 participants