Cross-cutting · Realtime updates (Pusher)

A websocket channel used for two things: streaming a customer’s captured signature into the open customer form, and delivering AI-generated proposal images when they are ready.

AreaCross-cutting
Routescrm.users.edit · cms.proposals.new
Centre modulesalways available
Staff levelsas per the host screen
Modelsproposal · user
UI labelerror.signature.not_exist
Coverage3 use cases · 2 happy · 3 failure

Known issues (1)

How it works

pusher.connectToChannel(id, callback) subscribes per record and disconnectToChannel(id) is called in willDestroyElement, so subscriptions are scoped to the open form. In the customer form the callback simply writes model.signatureUrl, which is what makes a signature captured on a paired tablet appear without a reload. In the proposal editor the same mechanism carries the result of an AI image generation, which is inherently slow. There is no reconnection or fallback polling: if the socket drops, the update silently never arrives and the user must reload.

Use cases

Why someone opens this (3)

  • A customer signing a GDPR consent on a tablet while the operator watches it appear on the record.
  • Waiting for an AI-generated proposal image without polling or reloading.
  • Keeping a long-lived form in step with an out-of-band action.

Path map

flowchart LR
    F(["Realtime updates Pusher"]):::feat
    F --> H1["Signature appears live"]:::ok
    F --> H2["AI image delivered"]:::ok
    F -.-> X1["Socket connection lost"]:::bad
    F -.-> X2["Signature not captured"]:::bad
    F -.-> X3["Subscription leak"]:::bad
    classDef feat fill:#8c5a3c,stroke:#8c5a3c,color:#ffffff,font-weight:bold
    classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e
    classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13

Happy paths

Signature appears live

  1. Operator opens an existing customer; the form subscribes to that user’s channel.
  2. The customer signs on a paired device and the signature is stored.
  3. The pushed URL is written to model.signatureUrl and renders immediately.
  4. Leaving the form unsubscribes.

AI image delivered

  1. User requests an AI image on a proposal.
  2. Generation runs asynchronously; the result arrives over the channel.
  3. The image is offered for review and attachment.

Failure paths

QA checklist

Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.

  • ✅ Signature appears live
  • ✅ AI image delivered
  • ⛔ Socket connection lost
  • ⛔ Signature not captured
  • ⛔ Subscription leak

Implementation


Generated from doc/feature-inventory.json · id xc-realtime · commit 276788ca6