Repository navigation
fix: prevent proposal shortlisting and acceptance race conditions - #261
tim-dev212 wants to merge 1 commit into
Conversation
|
@tim-dev212 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
8b9f5b6 to
1520402
Compare
|
Warning Possible malicious code: please review before merging. An automated security scan flagged files in this pull request that appear to contain malicious code. Code like this can run automatically when a project is opened in an editor or its dependencies are installed, so it could compromise the machine of anyone who checks out this branch. Automated scans can be wrong, so this may be a false positive. Maintainers: please review the flagged files carefully before merging, on GitHub in your browser rather than by checking out the branch. The malicious part is often hidden far off to the right of an ordinary-looking line, so scroll sideways through each file. @tim-dev212: this pull request adds or changes these files, possibly without your knowledge. Malware like this spreads by adding itself to repositories on machines it has infected, so your machine might be compromised. Please undo these changes in this pull request, and don't open or run other projects on that machine until you've checked it. Flagged files at commit Only merge once you're confident these files are safe. ℹ️ Posted automatically by Drips Wave. Questions? Contact support@drips.network. |
Overview
This PR hardens the proposal shortlisting and acceptance workflow against race conditions and data consistency issues. It adds ownership and status validation, wraps shortlist/accept/reject actions in database transactions, enforces a single accepted proposal per single-award project via database constraints, records acceptance/rejection outcomes consistently, and makes duplicate or conflicting requests return predictable results.
Related Issue
Changes
🔒 Proposal Action Concurrency Control
[MODIFY]
app/api/proposals/[id]/route.ts[MODIFY]
app/api/projects/[id]/proposals/route.ts[MODIFY]
lib/db.ts[MODIFY]
lib/audit-log.ts[ADD]
lib/db/migrations/010_project_proposals.sql[ADD]
lib/db/migrations/010_proposals.sqlVerification Results
lib/db.tstransaction helperCloses #243