openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

[Bug][Telegram] Connected/link-success state shown but messaging throws cancellation errors

Open Al629176 opened this issue 7 months ago • 1 comments

Summary

Telegram shows as connected / linked successfully, but sending messages immediately throws repeated errors (e.g. “Sorry, I encountered an error: Cancelled by newer request”).

Problem

Connection/auth appears successful, but runtime messaging fails right after linking. This creates a false-success state and broken UX.

Steps to reproduce

  1. Open Telegram bot and run /start.
  2. Complete login/link flow (“Telegram account linked successfully. You can return to the app.”).
  3. Send a normal message (e.g. “hello”).
  4. Observe repeated error replies.

Expected

After successful link, bot should process and respond to messages normally.

Actual

Bot reports errors/cancellations after connection, despite showing linked status.

Tasks

  • [ ] Reproduce and capture logs for link flow + first post-link messages.
  • [ ] Audit request cancellation logic (Cancelled by newer request) for Telegram channel.
  • [ ] Fix race conditions between:
    • link/auth completion
    • session initialization
    • first incoming message handling
  • [ ] Ensure “connected” status is only shown when messaging path is actually ready.
  • [ ] Add retry/debounce handling to avoid duplicate cancellation cascades.
  • [ ] Improve error messaging (actionable recovery steps instead of generic failure).
  • [ ] Add regression test:
    • connect Telegram -> send first message -> receive successful response.

Acceptance criteria

  • [ ] Linked/connected state reliably implies message path is operational.
  • [ ] First and subsequent Telegram messages process without cancellation errors.
  • [ ] No repeated “Cancelled by newer request” spam for normal user input.
  • [ ] Regression test passes in CI/local harness.

Al629176 avatar Apr 08 '26 15:04 Al629176

@Al629176 test this and close this i feel this is done

graycyrus avatar Apr 16 '26 05:04 graycyrus