Skip to content

fix: reject reject_submission after completion_deadline - #74

Merged
JamesVictor-O merged 1 commit into
Ads-Bazaar:mainfrom
Tijesunimi004:fix/reject-submission-completion-deadline
Aug 22, 2026
Merged

fix: reject reject_submission after completion_deadline#74
JamesVictor-O merged 1 commit into
Ads-Bazaar:mainfrom
Tijesunimi004:fix/reject-submission-completion-deadline

Conversation

@Tijesunimi004

Copy link
Copy Markdown
Contributor

Summary

claim_payment auto-approves a submitted proof once env.ledger().timestamp() > campaign.completion_deadline, specifically so an unresponsive business can't hold a creator's payout hostage. reject_submission had no matching deadline check, so a business could wait until after the deadline and still call reject_submission, flipping an already auto-approved application to Rejected. At that point the creator can no longer submit_proof (blocked by the same deadline) or claim_payment (status is no longer ProofSubmitted) — the auto-approval guarantee is defeated by the exact counterparty it's meant to protect against.

Fix

reject_submission now returns Error::ContentDeadlinePassed once called after campaign.completion_deadline, using the same > comparison claim_payment already uses to decide auto_approved, so the two stay consistent.

Test plan

  • Added reject_after_content_deadline_cannot_defeat_auto_approval: submits proof, advances past completion_deadline, asserts reject_submission fails with Error::ContentDeadlinePassed while claim_payment still succeeds (auto-approved).
  • Full workspace test suite passes (96 unit + 16 integration tests).
  • cargo clippy --all-targets -- -D warnings is clean.

Closes #58

claim_payment auto-approves a submitted proof once completion_deadline
passes, as a safety valve against an unresponsive business. Without a
matching check, reject_submission let the business flip an
auto-approved submission to Rejected after the deadline, leaving the
creator unable to submit_proof again (blocked by the same deadline)
or claim_payment (status no longer ProofSubmitted). That defeats the
auto-approval guarantee entirely.
Copilot AI lite review requested due to automatic review settings August 20, 2026 14:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@JamesVictor-O JamesVictor-O left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: verified the > comparison in reject_submission matches the existing convention across the file (submit_proof, claim_payment, expire_campaign), confirmed no legitimate business workflow is blocked (dispute/freeze recourse remains deadline-free), and confirmed the regression test genuinely proves the fix (claim_payment still succeeds via auto-approval while reject_submission is blocked). CI green, local test run confirmed passing. Approving.

@JamesVictor-O
JamesVictor-O merged commit 0aadc92 into Ads-Bazaar:main Aug 22, 2026
4 checks passed
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.

bug: reject_submission has no deadline check, letting a business defeat auto-approval after the completion deadline

3 participants