Required-comment status-change flow isn't transactional (client and server) #37
Open
opened 2026-08-31 21:29:44 -04:00 by jared
·
0 comments
No Branch/Tag Specified
main
development
fix/comment-markdown-persist-18
deploy-2026.09.09-182
deploy-2026.09.09-178
deploy-2026.09.08-172
deploy-2026.09.01-163
deploy-2026.08.08-155
deploy-2026.08.08-151
deploy-2026.08.08-147
deploy-2026.08.08-143
deploy-2026.08.08-139
deploy-2026.07.15-130
deploy-2026.07.15-122
deploy-2026.07.11-107
deploy-2026.06.30-96
deploy-2026.06.30-92
deploy-2026.06.30-88
deploy-2026.06.30-84
deploy-2026.06.30-80
deploy-2026.06.30-76
deploy-2026.06.30-72
deploy-2026.06.30-68
deploy-2026.04.29-49
deploy-2026.04.29-41
deploy-2026.04.18-35
deploy-2026.04.16-31
deploy-2026.04.16-27
deploy-2026.04.16-23
deploy-2026.04.16-11
deploy-2026.04.14-9
Labels
Clear labels
api
bug
concurrency
config
data-integrity
dead-code
documentation
duplicate
enhancement
help wanted
invalid
needs-decision
notifications
performance
priority/docs
priority/high
priority/low
priority/medium
question
rate-limiting
reliability
security
ux
wontfix
workflow
Bearer/internal API surface
Something is not working
Race condition / concurrency bug
Configuration / deployment default
Data correctness / schema / integrity issue
Unused / dead code cleanup
README / docs accuracy
This issue or pull request already exists
New feature
Need some help
Something is wrong
Needs a maintainer decision, not clearly a bug
Matrix / in-app notification bug
Performance or resource-usage concern
Documentation-only gap
High-severity / high-impact issue
Low-severity / cosmetic issue
Medium-severity issue
More information is needed
Rate limiting behavior
Reliability / error-handling gap
Security or access-control impact
User-facing UX/functional bug
This won't be fixed
Ticket status workflow engine
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: LotusGuild/tinker_tickets#37
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Severity: Medium
When a status transition requires a comment (e.g. closing a ticket), the comment is persisted before the status update, with no shared transaction or rollback if the second step fails. This shows up in two places:
assets/js/ticket.js(~lines 547-560) —POST /api/add_comment.phpruns first, thenPOST /api/update_ticket.php.api/ticket_status_api.php(~lines 130-165) — same ordering for the Bearer API's status-change endpoint.Impact: If the second call fails (network blip, CSRF resync race, workflow re-validation failure) the comment has already been persisted — the ticket is left with a "reason" comment permanently attached but no accompanying status change, and the only user feedback is a generic error toast that doesn't mention the orphaned comment.
Fix: Either combine comment+status-change into a single server-side transactional operation (preferred — add an optional
commentparam toupdate_ticket.phpthat inserts the comment in the same DB transaction as the status update, whichticket_status_api.phpalready supports per the README), or roll back / delete the comment client-side if the status-update call fails.