Repository navigation
Keep rejected gift fallbacks retryable - #28
Conversation
|
@codex Please review this fix for the P2 you found in the full-repository audit. Focus on whether the rejected |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d0ea5f65e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (sent) return { sent: true }; | ||
|
|
||
| // sendMessage() returning false means neither supported chat transport | ||
| // accepted the command. If we still own the giveaway, no transfer was | ||
| // initiated, so restore this exact terminal marker to retryable state. |
There was a problem hiding this comment.
Do not retry ambiguous chat API failures
When /api/chat/messages times out or throws after the server has accepted the /gift, and no chatbox fallback is available, sendMessage() returns false: it catches the ambiguous API failure and then returns sendViaChatbox()'s failure. This branch treats that result as definitive and restores the ledger token to retryable, so the next settlement retry can send the same gift again. Preserve the terminal/ambiguous marker unless the transport can specifically report that no request was initiated or accepted.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed. The /gift fallback now forces the synchronous chatbox-only path, so no /api/chat/messages request is made in this recovery branch. A false result is therefore a definitive no-dispatch rather than an ambiguous API timeout. I also added regression assertions for forceChatboxOnly and the API gate, then rebuilt the generated userscript.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
/giftfallback sendssendMessage()result instead of assuming the fallback was sentFailure fixed
Previously
fallbackToChat()terminalized the transfer ledger before callingsendMessage(cmd), then ignored afalseresult and returned success. If neither chat transport accepted the/gift, later settlement could treat an unsent winner payout/refund as already attempted.Safety
The recovery path requires the current tab to still own the giveaway, checks the exact numeric terminal marker produced for this attempt, writes the retryable token, performs durable ledger read-back, and never retries ambiguous HTTP/network sends.