Skip to content

fix: 每日充電在互動逾時時不再遺失簽到 - #531

Merged
itousouta15 merged 1 commit into
devfrom
fix/charge-commit-before-send
Sep 6, 2026
Merged

itousouta15 merged 1 commit into
devfrom
fix/charge-commit-before-send

Conversation

@itousouta15

Copy link
Copy Markdown
Member

問題

2026-09-06 00:32,使用者 percy314159 執行 /charge 時,
eward()\ 已寫入 DB,但 \send_message()\ 因 Discord 互動逾時拋出 \NotFound (404)\。

\mysql_connection()\ 只處理 \mysql.connector.errors.Error\,\NotFound\ 不會 commit 也不會 rollback,連線關閉時隱式 rollback,導致該次簽到(combo、point、last_charge)全部遺失。隔天 \is_cross_day\ 判定斷簽,combo 從 304 歸 1。

修正

在
eward()\ 寫入後、\send_message()\ 前先 \connection.commit()\,確保簽到已持久化。互動逾時只會影響回覆顯示,不會影響簽到記錄。

驗證

  • 已修復該用戶資料(combo 305、補回 5 point)
  • 伺服器已部署並重啟,bot 正常上線

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • development

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 1bbe46bf-773f-4d74-ac5c-191595d1f68d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@itousouta15
itousouta15 changed the base branch from main to dev September 6, 2026 16:56
@itousouta15
itousouta15 force-pushed the fix/charge-commit-before-send branch from 3b2d161 to 92b64eb Compare September 6, 2026 16:58
@itousouta15
itousouta15 merged commit 83441de into dev Sep 6, 2026
17 checks passed
@winstonsung winstonsung added the bug Something isn't working label Sep 7, 2026
@winstonsung winstonsung added this to the 0.1.16 milestone Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants