Attachment QR code
This diagram shows a simple Attachment QR flow.
The flow allows a user to continue file upload on another device by scanning a one-time QR code. The main flow creates and checks that one-time code, while the QR flow exchanges it for a session and uploads attachments.
QR code session
How it works
- Main flow asks Main BFF for a one-time QR code.
- Main BFF forwards the request to API and returns the generated one-time code to main flow.
- Main flow checks whether the one-time code has been used, by checking statuses
Used/NotUsed/Expired - Main flow gets attachment updates through
GET conversations/conv1/attachments/node1; a pulling mechanism should be used, where main flow periodically calls this endpoint (polling) to fetch changes for files uploaded in QR flow. - User scans the QR code URL, which opens QR flow.
- QR flow exchanges the one-time code through QR BFF to create a QR session.
- QR flow uses that session to read attachment node state and upload files.
Component roles
- Main Flow: Original conversation flow where the attachment node is rendered.
- Main BFF: Backend-for-frontend for the main flow; proxies attachment-QR endpoints.
- API: Core backend that generates one-time codes, tracks usage, and stores attachments.
- QR Flow: Mobile/browser flow opened from the scanned QR code.
- QR BFF: Backend-for-frontend for QR flow; maps QR endpoints to QR session API routes.
Result
After the exchange step, uploads done in QR flow are available to the original attachment node in main flow. This lets users attach files from a second device without losing the original conversation context.