fix: sync /api/status loginState with actual logged_in_user from DB - #161
Open
foshanfm wants to merge 1 commit into
Open
fix: sync /api/status loginState with actual logged_in_user from DB#161foshanfm wants to merge 1 commit into
foshanfm wants to merge 1 commit into
Conversation
Before this fix, /api/status always returned loginState.status as 'logged_out' regardless of actual login state. This caused inconsistency where: - /api/status → logged_out - /api/status/auth → logged_in - sending messages failed with NOT_LOGGED_IN Now get_status() reads the session's logged_in_user from the database and derives the loginState.status from that, which is consistent with how auth_status() determines login state. Fixes: thisnick#110 (similar issue with login state inconsistency)
This was referenced Aug 12, 2026
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.
问题
/api/status始终返回logged_out,即使微信已登录。导致消息发送失败。原因
get_status()函数硬编码返回logged_out,没有读取数据库中实际的登录状态。修复
get_status()读取session.logged_in_user字段,与auth_status()保持一致。测试
/api/status→logged_in✅/api/status/auth→ 一致 ✅/api/messages/send→{"success":true}✅改动
packages/agent-server-rust/src/router/status.rs: 8行修改Fixes #110