Skip to content

Handle affiliate approval notification failures#204

Open
morganschp wants to merge 2 commits into
profullstack:masterfrom
morganschp:fix-affiliate-approval-notification-failure
Open

Handle affiliate approval notification failures#204
morganschp wants to merge 2 commits into
profullstack:masterfrom
morganschp:fix-affiliate-approval-notification-failure

Conversation

@morganschp
Copy link
Copy Markdown

@morganschp morganschp commented May 21, 2026

Fixes #203.
Fixes #163.

Summary

  • treat affiliate application approval/rejection notifications as best-effort after the status update succeeds
  • reject malformed or non-object affiliate application status request bodies before offer/application update or notification work
  • log notification insert errors or thrown failures instead of returning a false 500 to the seller UI
  • add route regression coverage for malformed JSON, non-object JSON, and a failed notification insert

uGig task

Submitted for the active uGig repo testing task: https://ugig.net/gigs/4741218f-a723-46bb-82cb-6516120331ae

No payout details included; those can be provided after acceptance.

Verification

  • ./node_modules/.bin/vitest run 'src/app/api/affiliates/offers/[id]/applications/route.test.ts'
  • ./node_modules/.bin/eslint 'src/app/api/affiliates/offers/[id]/applications/route.ts' 'src/app/api/affiliates/offers/[id]/applications/route.test.ts'
  • ./node_modules/.bin/prettier --check 'src/app/api/affiliates/offers/[id]/applications/route.ts' 'src/app/api/affiliates/offers/[id]/applications/route.test.ts'
  • ./node_modules/.bin/tsc --noEmit --pretty false
  • git diff --check -- 'src/app/api/affiliates/offers/[id]/applications/route.ts' 'src/app/api/affiliates/offers/[id]/applications/route.test.ts'

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: affiliate approval can return 500 when notification write fails bug: affiliate application status API returns 500 on malformed JSON

1 participant