Skip to content

fix(backend): harden documents, webhooks, and batch shipments - #1616

Merged
mftee merged 2 commits into
CodeGirlsInc:mainfrom
Hassan-oladipupo:feature/document-webhook-and-shipment-repair
Sep 25, 2026
Merged

mftee merged 2 commits into
CodeGirlsInc:mainfrom
Hassan-oladipupo:feature/document-webhook-and-shipment-repair

Conversation

@Hassan-oladipupo

Copy link
Copy Markdown
Contributor

Summary

  • make document uploads self-cleaning across every failure path
  • keep document metadata and disk state consistent during deletion
  • cap webhook registrations and delivery fan-out per user
  • remove duplicated shipment batch-creation fragments so the backend compiles again

Changes

  • add upload cleanup interception, MIME prevalidation, and service-level failure cleanup
  • use a tombstone/rollback deletion sequence with safe ENOENT handling
  • enforce a configurable WEBHOOK_MAX_PER_USER limit (default 10) with advisory-lock creation and defensive delivery bounds
  • retain the current per-item transaction implementation for batch shipment creation

Testing

  • npm run build
  • 8 focused Jest suites passed (66 tests), including upload integration and concurrent webhook coverage
  • npx tsc --noEmit -p tsconfig.build.json
  • targeted ESLint/Prettier checks and git diff --check

Closes #1539
Closes #1540
Closes #1541
Closes #1542

@vercel

vercel Bot commented Sep 25, 2026

Copy link
Copy Markdown

@Hassan-oladipupo is attempting to deploy a commit to the Mftee's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@Hassan-oladipupo 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! 🚀

Learn more about application limits

…ook-and-shipment-repair

# Conflicts:
#	backend/src/admin/admin.service.ts
#	backend/src/documents/document-file.util.ts
#	backend/src/documents/documents.controller.spec.ts
#	backend/src/documents/documents.controller.ts
#	backend/src/documents/documents.module.ts
#	backend/src/documents/documents.service.spec.ts
#	backend/src/documents/documents.service.ts
@mftee
mftee merged commit 09c2afb into CodeGirlsInc:main Sep 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment