feat: push dispatch, file soft/hard-delete, push hygiene & coalescing#282
Merged
codebestia merged 4 commits intoJun 29, 2026
Merged
Conversation
Closes codebestia#231, codebestia#236, codebestia#237, codebestia#239 codebestia#236: content-free web push to offline devices after send_message codebestia#237: prune 410/404 subscriptions, backoff on transient failures, lastUsedAt tracking codebestia#239: 2s coalesce window per device+conversation, 30s per-device rate limit codebestia#231: files table, soft-delete on retraction, background hard-delete S3 job
|
@Chidimj 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! 🚀 |
Owner
|
Hello @Chidimj |
Owner
|
/home/runner/work/clicked/clicked/apps/backend/src/socket/messaging.ts 1 Error to fix |
codebestia
approved these changes
Jun 29, 2026
codebestia
left a comment
Owner
There was a problem hiding this comment.
LGTM!
Thank you for contribution.
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
Implements four related delivery-pipeline issues in a single cohesive PR.
{ type, conversationId, messageId, count }— no ciphertext, no sender data. Client syncs and decrypts locally on open.disabled_at);last_used_atupdated on every successful send; backoffs re-enabled by the background job.(deviceId, conversationId)collapses N messages into one push with accuratecount. Per-device rate limit of one push per 30 seconds prevents spam.filestable tracks S3 objects;messages.file_idFK added; soft-delete fires on message retraction (REST + socket); background job hard-deletes from S3 when no live message reference remains (ref-counted). Idempotent —hard_deleted_atset only after successful S3 delete.Changes
drizzle/0009_push_file_hygiene.sqlfilestable,messages.file_id,push_subscriptions.last_used_at/disabled_atsrc/db/schema.tsfilestable,fileIdon messages,lastUsedAt/disabledAton pushSubscriptionssrc/services/pushNotification.tssrc/services/fileCleanup.tssrc/services/deviceRevocation.tsisDeviceConnected()exportedsrc/socket/messaging.tssend_messagesrc/routes/messages.tssoftDeleteFile()called on REST message deletesrc/index.tsstartFileCleanupJob()wired at bootsrc/__tests__/pushNotification.test.tssrc/__tests__/fileCleanup.test.tssrc/__tests__/messages.routes.test.tssoftDeleteFileTest plan
pnpm test)tsc --noEmit)disabled_atcount: 3hard_deleted_atnot set → safe retryCloses #231
Closes #236
Closes #237
Closes #239