Repository navigation
Prepare login, ready, logout and group text for the first alpha - #16
Merged
Merged
Conversation
Emit login after the account profile loads, and ready after the initial sync. Update wechat-protocol to 2.2.0 and use its typed errors: when a sync or heartbeat fails without a service code, reconnect once and repeat it, so signing out from the phone ends in logout rather than an error. Error events now name WeChat's service and code when it answered. Group text carries the group as roomId and the member as talkerId, and the example replies in the group. Closes #12 Closes #13 Closes #14 Closes #15 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The four items Huan raised before the first npm alpha.
loginafter the profile (Emit login after the account profile loads #12). Neo looks up the account's profile, then emitslogin, so aloginlistener reads the nickname. If the lookup fails,loginstill fires and the name falls back to the WeChat ID, then the username.readyafter the initial sync (Emit ready after the initial sync #13).readynow follows the initial sync instead of the first heartbeat.logoutwithWeChat ended the session. This uses the typed errors in wechat-protocol 2.2.0 instead of matching error text. Error events also name WeChat's service and code when it answered, for exampleNeo could not read a sync page: Sync service returned -1.roomIdand the member who posted it astalkerId. WeChat puts the member's ID in front of group text; Neo removes it, following the same rules as agent-wechat's daemon, and skips a group message whose sender it cannot read.messageSendText()accepts a group Neo has received a message from, and the example replies in the group.The spec and README describe the new lifecycle, group handling and the live acceptance steps.
Testing
cargo test,cargo clippy -D warningsandcargo fmt --checkpass. New Rust tests cover a socket closed by phone sign-out ending the session, reconnect and renewal limits, typed-only session rejection, and group sender parsing.npm test(build, typecheck, 9 tests) andnpm run test:packagepass on Node.js 26 (Linux x64). New tests cover thelogin→ initial sync →readyorder, group payloads and replies, logout when sync fails after sign-out, and the example replying directly and in a group.Closes #12
Closes #13
Closes #14
Closes #15
🤖 Generated with Claude Code