fix(qqbot): accept is_reconnect kwarg in connect() to match base class contract - #57266
Closed
liuhao1024 wants to merge 1 commit into
Closed
liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
…s contract The gateway's reconnection logic passes is_reconnect=True when reconnecting a previously-connected platform (gateway/run.py:3334). Every other adapter accepts this keyword argument, but QQBot's connect() signature omitted it, causing TypeError on every reconnect attempt and an infinite backoff loop.
Duplicate of #52966 — the earliest still-open canonical fix for the same QQBot |
Contributor
Author
|
Superseded by #52966 which covers the same |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds the missing
is_reconnectkeyword argument toQQAdapter.connect()so it matches the base classPlatformAdapter.connect()contract. Without this, the gateway's reconnection logic passesis_reconnect=Trueand QQBot raisesTypeError: connect() got an unexpected keyword argument 'is_reconnect', entering an infinite backoff loop.Related Issue
Fixes #57252
Type of Change
Changes Made
gateway/platforms/qqbot/adapter.py— Changedasync def connect(self) -> bool:toasync def connect(self, *, is_reconnect: bool = False) -> bool:to match the abstract method signature ingateway/platforms/base.py:2864and every other platform adapter.How to Test
pytest tests/gateway/test_qqbot.py -qshould passChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/gateway/test_qqbot.py -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A