Skip to content

fix(nodejs): harden API retries and polling lifecycle - #116

Open
duohelingdukele wants to merge 2 commits into
corespeed-io:mainfrom
duohelingdukele:fix/operation-aware-retries
Open

duohelingdukele wants to merge 2 commits into
corespeed-io:mainfrom
duohelingdukele:fix/operation-aware-retries

Conversation

@duohelingdukele

@duohelingdukele duohelingdukele commented Oct 22, 2026 •

Copy link
Copy Markdown

Summary

  • Make retries operation-aware: only explicitly opted-in API operations retry transient transport failures; getUpdates remains owned by the poller and resumes from the last committed cursor.
  • Process each incoming batch and persist context before committing its cursor. A handler or storage failure leaves the cursor unchanged, so the batch can be delivered again. Emit poll:success only after processing and cursor persistence complete.
  • Add an instance-level AbortSignal for API requests and polling, plus autoRelogin (default: true) so hosted applications can stop on session expiry and handle reauthorization themselves.
  • Await asynchronous QR login callbacks, call onExpired when a pairing-code challenge is blocked, and allow QR status polling up to 60 seconds.
  • Document the lifecycle options and at-least-once delivery behavior.

Delivery behavior

Incoming batches may be replayed if a handler or storage write fails. Applications should make external side effects in message handlers safe to repeat.

Validation

  • npm run lint passed (tsc --noEmit).
  • Tests were not run for this update.

@duohelingdukele duohelingdukele changed the title fix(nodejs): make API retries operation-aware fix(nodejs): harden API retries and polling lifecycle Oct 22, 2026

This branch has not been deployed

No deployments
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.

1 participant