Repository navigation
v0.5.0
Changes
- Preserve
message_id, itemmsg_id, and quotedsvr_idwithout precision loss, accepting JSON strings and the full uint64 numeric range. - Expose server message IDs through
SendResult.MessageIDandAfterSend. - Restore text references from a persistent, account- and peer-scoped local cache, including references containing only an ID. Support validated partial-text selection and optional MD5 checks.
- Prefer the top-level message ID, then the first valid item ID. Prefer quoted
svr_id, then the nested item ID. ID-only placeholders query the cache and reportmissingwhen unavailable in history; real embedded content is preserved. - Keep successful sends successful when cache persistence fails; report typed
QuoteCacheErrorseparately.
Migration from v0.4.x
WireMessage.MessageID and MessageItem.MsgID now use wechatbot.MessageID, a string-based type. Use string literals to construct or compare IDs. For numeric values, format with strconv.FormatUint or strconv.FormatInt before converting to wechatbot.MessageID; do not directly cast an integer. Empty and zero IDs normalize to an empty string, and JSON output uses strings. Existing nonzero numeric replay keys are unchanged.
The text cache is enabled by default and can be disabled with QuoteCache.Disabled. It defaults to 30-day retention and 10,000 entries per account, with a 64 KiB per-text limit and 16 MiB aggregate content/identity budget. One cache file must have only one Bot/process writer. Corrupt files are preserved and reported rather than silently replaced.
This release restores text and voice transcripts only; media files and history predating the cache cannot be recovered from an ID alone. Delivery and cursor commit decisions remain independent of cache persistence.
Validation
-
CI on the published commit: Windows, Linux, and macOS build/tests passed with Go 1.25.0; Linux also passed module verification, vet, and the race suite.
-
Windows: full test/race suites, build, vet, module verification, and whitespace checks passed; protocol race tests and the full build were rerun after the version bump.
-
Regression coverage includes numeric/string ID extremes, source/reference ID precedence, restart recovery, cache isolation/failure/limits, partial-text validation, and embedded-content preservation. The concurrent recovery fixture now synchronizes expiry with handler startup; its targeted race test passed 100 repetitions, followed by the full race suite and vet.
-
Live WeChat and UI acceptance were not performed.
Install: go get github.com/Icatme/wechatbot-go@v0.5.0.