Skip to content

fix(api): detect non-zero errcode envelope in sendMessage - #325

Open
do-nothing wants to merge 1 commit into
Tencent:mainfrom
do-nothing:fix/sendmessage-errcode-check
Open

do-nothing wants to merge 1 commit into
Tencent:mainfrom
do-nothing:fix/sendmessage-errcode-check

Conversation

@do-nothing

Copy link
Copy Markdown

The Weixin gateway can reject a send with HTTP 200 plus an errcode field (observed: errcode=-14 "session timeout" with a stale context_token). The previous code only checked ret, so the failure was swallowed and logged as "text sent OK". Treat a non-zero errcode as an error and have the channel layer discard the stale context token on -14 so the next send waits for a fresh inbound token.

The Weixin gateway can reject a send with HTTP 200 plus an errcode field
(observed: errcode=-14 "session timeout" with a stale context_token). The
previous code only checked ret, so the failure was swallowed and logged as
"text sent OK". Treat a non-zero errcode as an error and have the channel
layer discard the stale context token on -14 so the next send waits for a
fresh inbound token.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant