Skip to content

listen() renews its Teams session instead of ending the feed - #49

Merged
PianoNic merged 1 commit into
mainfrom
fix/live-session-renewal
Nov 6, 2026
Merged

PianoNic merged 1 commit into
mainfrom
fix/live-session-renewal

Conversation

@PianoNic

@PianoNic PianoNic commented Nov 6, 2026

Copy link
Copy Markdown
Owner

listen() used to end the feed when Teams' session token was about to expire, about 75 minutes in, if it was started with reconnect=False. A planned renewal isn't a failure, so it now signs in again and reconnects straight away in both modes, without backing off, and yields connected again.

Testing

  • The tests pass, including a new one for renewal with reconnect=False. Ruff and mypy are clean.
  • Live, on a real account: with the session set to expire early, the feed renewed about 11 s after connecting, twice, and stayed up. A self-chat message sent 1 s after each renewal arrived after 132 ms and 116 ms. One earlier run missed a message sent 2 s after renewal within 5 s, and I couldn't reproduce or explain it. Apps should keep catching up on connected, as docs/live.md says.
  • Before this change, a real 90-minute stream with reconnect=False ended after about 75 minutes.

Not tested: a natural expiry on a long-running stream after this change. The live runs made the session expire early instead.

With reconnect=False the feed ended about 75 minutes in, when the session
token was about to expire. Renewal is planned, not a failure, so it now
reconnects straight away in both modes.
@PianoNic PianoNic added the bug Something isn't working label Nov 6, 2026
@PianoNic
PianoNic merged commit 9c55254 into main Nov 6, 2026
5 of 9 checks passed
@PianoNic
PianoNic deleted the fix/live-session-renewal branch November 6, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant