picoclaw/pkg/channels/wecom
esubaalew 29e9b6b4b5 fix(wecom): replace dedupe map rotation with circular queue
The previous dedupe map rotation logic completely cleared the map when it reached max size, causing an 'amnesia cliff' where immediately arriving duplicates of just-forgotten messages would be processed.

This change replaces that with a MessageDeduplicator struct that uses a circular queue (ring buffer) to track insertions. When the limit is reached, it only evicts the absolute oldest message from the map, completely resolving the cliff issue.

This also cleans up the WeCom Bot and App webhook handlers by encapsulating the mutex and map state.
2026-03-02 18:50:51 +03:00
..
aibot.go refactor(aibot): remove downloadAndDecryptImage function to streamline image handling 2026-03-02 18:21:53 +08:00
aibot_test.go refactor(wecom): replace generateSignature with computeSignature and update related tests 2026-03-02 17:42:54 +08:00
app.go fix(wecom): replace dedupe map rotation with circular queue 2026-03-02 18:50:51 +03:00
app_test.go Merge pull request #535 from xiaket/ci-enable-dupl-linter 2026-03-02 18:55:35 +08:00
bot.go fix(wecom): replace dedupe map rotation with circular queue 2026-03-02 18:50:51 +03:00
bot_test.go Merge pull request #535 from xiaket/ci-enable-dupl-linter 2026-03-02 18:55:35 +08:00
common.go refactor(wecom): streamline AES encryption/decryption and improve task management logic 2026-03-02 17:42:54 +08:00
dedupe.go fix(wecom): replace dedupe map rotation with circular queue 2026-03-02 18:50:51 +03:00
init.go Add WeCom AIBot channel implementation and tests 2026-03-02 17:42:42 +08:00