Problem
Some coupons are observed in chat as remaining "available" or otherwise in an inconsistent state after being marked used / returned, causing user confusion and manual fixes.
Evidence
-
Chat: 2026-08-15 16:14 — user c2e02bd9: "Хотела бы сказать, что мой купон ID:1645: 5€ из 25€ сгорает завтра (приложение до сих пор отражает его как неиспользованный). Может, кто-то его взял и не использовал? В списке доступных у меня в бот"
-
Chat thread (multiple messages) 2026-08-05 17:01–17:04 showing confusion about a used coupon and a reported/returned workflow:
- 2026-08-05 17:01
bae0bde9: "У меня приключения продолжаются. Хотя этот купон уже использовали ко мне пришло такое сообщение Пользователь @lstct сообщил, что купон ID:1534 уже был использован. Если вы использовали его вне бота —"
- 2026-08-05 17:02
bae0bde9: "Тут писали, что использовали"
- 2026-08-05 17:03
99971a65: "Я его его брала и использовала несколько дней назад. А сейчас мне зачем-то пришло уведомление, что его вернули"
- 2026-08-05 17:04
abab42dc: "Я его не использовала по факту. Я его взяла. По ошибке отметила использованным. Потом Айрат его вернул в неиспользованные. А я потом его вернула из взятых. … Его судьбу потом я не знаю 🙄"
-
Funnel / events (from product data): used_reverted occurrences coincide with the same period:
- 2026-08-05:
used_reverted 1 1
- 2026-08-02:
used_reverted 1 1
-
Engagement / callback summary (7d): take = 98, used = 82, return = 16 (product-data-report "Callback Actions (7 days)"). These counts show active usage of the take/used/return flows while the chat reports mismatch incidents.
Code Checked
n/a — not a missing-behavior claim (this is a correctness/consistency bug, not a request for a new command).
Expected Behavior
- When a coupon is marked used in the system, it should not appear as available to other users and related notifications should be consistent (no duplicate "was used" vs "was returned" race messages). If a coupon is reverted/returned, the system should emit a clear, single terminal state and corresponding notification sequence that avoids ambiguous intermediate states.
Notes / Repro steps (suggested)
- Investigate race conditions between the "mark used", "return", and any async OCR/image recognition flows which may trigger state changes.
- Reproduce with a rapid sequence: user marks coupon used -> another actor returns/reverts it -> confirm DB events and emitted notifications (and whether any background job replays an older event).
Problem
Some coupons are observed in chat as remaining "available" or otherwise in an inconsistent state after being marked used / returned, causing user confusion and manual fixes.
Evidence
Chat: 2026-08-15 16:14 — user
c2e02bd9: "Хотела бы сказать, что мой купон ID:1645: 5€ из 25€ сгорает завтра (приложение до сих пор отражает его как неиспользованный). Может, кто-то его взял и не использовал? В списке доступных у меня в бот"Chat thread (multiple messages) 2026-08-05 17:01–17:04 showing confusion about a used coupon and a reported/returned workflow:
bae0bde9: "У меня приключения продолжаются. Хотя этот купон уже использовали ко мне пришло такое сообщение Пользователь @lstct сообщил, что купон ID:1534 уже был использован. Если вы использовали его вне бота —"bae0bde9: "Тут писали, что использовали"99971a65: "Я его его брала и использовала несколько дней назад. А сейчас мне зачем-то пришло уведомление, что его вернули"abab42dc: "Я его не использовала по факту. Я его взяла. По ошибке отметила использованным. Потом Айрат его вернул в неиспользованные. А я потом его вернула из взятых. … Его судьбу потом я не знаю 🙄"Funnel / events (from product data):
used_revertedoccurrences coincide with the same period:used_reverted 1 1used_reverted 1 1Engagement / callback summary (7d):
take = 98,used = 82,return = 16(product-data-report "Callback Actions (7 days)"). These counts show active usage of the take/used/return flows while the chat reports mismatch incidents.Code Checked
n/a — not a missing-behavior claim (this is a correctness/consistency bug, not a request for a new command).
Expected Behavior
Notes / Repro steps (suggested)