-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(qqbot): restore AcpBridge session loading — return input sessionId, patch catch path #7722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1973,6 +1973,7 @@ export class QQChannel extends ChannelBase { | |
| onReady(); | ||
| }) | ||
| .catch(() => { | ||
| this.fixRestoredSessions(); | ||
|
Comment on lines
1975
to
+1976
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The Consider extracting the shared calls into .then(() => {
// success-specific: session count logging
})
.catch(() => {
// error-specific: warning log
})
.finally(() => {
this.fixRestoredSessions();
this.finalizeReady();
this._checkGroupAllPolicyRequireMention();
onReady();
});— qwen3.7-max via Qwen Code /review
Comment on lines
1975
to
+1976
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The READY cold-start Suggested: add a test that mocks — qwen3.7-max via Qwen Code /review |
||
| process.stderr.write( | ||
| `[QQ:${this.name}] WARNING: router session restore failed — cron messages will be dropped until sessions re-establish\n`, | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion]
AcpBridge.loadSessionhas no unit test —AcpBridge.test.tshas zero matches forloadSession. The very return-value bug this PR fixes (returningresponse.sessionIdwhich was alwaysundefined) went undetected because theSessionRoutertests mockloadSessionat the interface level and never exercise the real implementation. Without a test asserting the return value, a future regression re-introducingreturn response.sessionIdwould silently pass all existing tests.Suggested: add a test that mocks
conn.loadSessionto return aLoadSessionResponse(nosessionIdfield) and asserts thatbridge.loadSession()returns the inputsessionId.— qwen3.7-max via Qwen Code /review