[Backend] Stellar Wave — upload expiry, MIME validation, WebSocket tx status, migration rollback - #871
Merged
Ceejaytech25 merged 8 commits intoAug 1, 2026
Conversation
… after 30 days - Add UploadRecord model to schema with isTemporary flag and composite index - Add migration to add isTemporary column to existing UploadRecord table - Add deleteObject(key) to StorageProvider interface with implementations for MockStorageProvider, S3StorageProvider, and GcsStorageProvider - Add EXPIRED_DELETED to UploadStatus union type - Extend UploadExpiryScheduler with expireDbUploads() that queries DB for temporary records older than 30 days, deletes storage objects, and marks status as EXPIRED_DELETED; keeps in-memory expireStale() as fallback
Contributor
|
Nice implementation, LGTM! |
Contributor
|
Merged via main branch update. |
Ceejaytech25
added a commit
that referenced
this pull request
Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Covers four Stellar Wave backend issues.
#740 — TTL expiry scheduler for temporary document uploads
storage-provider.service.ts: addeddeleteObject(key)to interface + Mock/S3/GCS implementationsupload-store.service.ts: addedEXPIRED_DELETEDstatusupload-expiry.scheduler.ts: addedexpireDbUploads()— queries DB forisTemporary=truerecords >30 days old, deletes from storage, marksEXPIRED_DELETED; keeps in-memory fallbackprisma/schema.prisma: addedisTemporaryflag and composite indexCloses #740
#746 — Strict MIME-type validation for KYC uploads
storage-provider.service.ts:MAX_UPLOAD_SIZE_BYTES,validateUploadSize(size),validateKycUpload(buffer, declaredMimeType)— checks magic bytes (JPEGff d8 ff, PNG89 50 4e 47, PDF%PDF)Closes #746
#747 — WebSocket server for real-time transaction status
backend/src/lib/socket.ts(new):initSocket(httpServer),emitTxUpdated(payload), JWT auth middlewarebackend/src/index.ts: wraps Express inhttp.createServer, callsinitSocket, listens onhttpServerbackend/src/api/routes/transactions.route.ts:PATCH /api/transactions/:id/statusupdates DB and emitstx_updatedpackage.json: addedsocket.io ^4.8.1(runnpm installafter merging)Closes #747
#749 — Migration rollback with FK integrity verification
backend/scripts/rollback.ts(new):RollbackVerifier— checks FK violations viaPRAGMA foreign_key_check, prints report, applies rollback; supports--forceand--dry-runpackage.json: addedmigrate:rollback:verifyscriptdocs/MIGRATION_INTEGRITY.md: added Rollback Verification Procedure sectionCloses #749