Skip to content

Production Release#1658

Open
tarunnjoshi wants to merge 113 commits intomainfrom
dev
Open

Production Release#1658
tarunnjoshi wants to merge 113 commits intomainfrom
dev

Conversation

@tarunnjoshi
Copy link
Copy Markdown
Member

No description provided.

tarunnjoshi and others added 30 commits March 24, 2026 12:55
Adds a temporary sleep(3) inside generateInvoiceNumber() between
the SELECT FOR UPDATE and Contribution::update() calls. This holds
the row lock and widens the race window, making it trivial to
reproduce the CRM_Utils_Cache_SqlGroup duplicate-INSERT error
(coloredcow-admin/goonj-crm#305) with the concurrent webhook script.

Also adds the webhook simulation script and test results from 5 runs
(100 requests, 4% failure rate without the sleep).

DO NOT MERGE — this is a test-only branch for reproducing the bug.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Only the sleep(3) test code belongs in this PR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
test: widen race condition for issue #305 reproduction
Move the sleep(3) from inside the FOR UPDATE locked section in
generateInvoiceNumber() to the unlocked generateInvoiceIdForContribution().
This ensures multiple concurrent Contribution::update() calls actually
overlap, reproducing Tarun's exact CRM_Utils_Cache_SqlGroup duplicate
INSERT error rather than the deadlock at Contribution::create level.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Important

Review skipped

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

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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ddfdf875-44cc-44ec-959e-4f3f991eb4c6

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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 and usage tips.

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.

2 participants