Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: LoserFox/telegram
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: LoserFox/telegram
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/telegram-polloop
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on Aug 6, 2026

  1. fix: harden pollLoop against malformed getUpdates responses

    getUpdates passes the API's result through unchecked, so a 200 with a
    malformed body (direct or via a proxy) could resolve with null/undefined
    or a non-array. The for-loop and updates.length read then threw a
    TypeError outside any catch, rejecting the pollLoop promise and crashing
    the process with an unhandled rejection.
    
    - validate the batch with Array.isArray; log and continue on malformed
      responses instead of crashing
    - wrap the whole iteration (for loop included) in a try/catch as a
      second line of defense
    - skip malformed elements inside an otherwise valid batch
    - drop an in-flight batch that resolves after stop() to avoid creating
      sessions or sending messages during teardown; break out of the loop
      mid-batch if stop() ran
    - add vitest as a devDependency so the suite can run
    - add bridge tests for null/undefined/non-array responses, malformed
      elements, and the stop race
    LoserFox committed Aug 6, 2026
    Configuration menu
    Copy the full SHA
    0509efa View commit details
    Browse the repository at this point in the history
Loading