Repository navigation
Select only needed columns; drain in-flight webhook deliveries on shutdown - #796
Merged
nonsobethel0-dev merged 1 commit intoOct 19, 2026
Conversation
…tdown - Parashield-Protocol#757: getActiveProducts and getPolicy now select only the columns their mapping actually reads instead of fetching full rows — these are the two highest-traffic queries (public product list, every policy detail view + SSE heartbeat). - Parashield-Protocol#777: WebhooksService now tracks in-flight deliveries and drains them in onApplicationShutdown with a configurable timeout (WEBHOOK_SHUTDOWN_DRAIN_TIMEOUT_MS, default 10s) instead of letting SIGTERM abort a delivery mid-retry. Deliveries still pending at the timeout are logged, not auto-requeued — there is no persistent delivery log to resume them from yet. - Parashield-Protocol#758 and Parashield-Protocol#778: investigated, no code change — see PR description. Closes Parashield-Protocol#757 Closes Parashield-Protocol#758 Closes Parashield-Protocol#777 Closes Parashield-Protocol#778
|
@gboigwe 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! 🚀 |
nonsobethel0-dev
merged commit Oct 19, 2026
8f94ee8
into
Parashield-Protocol:main
0 of 3 checks passed
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
[perf] Prisma queries do not use select to limit returned columns #757 —
getActiveProducts(public products list) andgetPolicy(every policy detail view + every SSE heartbeat re-check) now use Prismaselectfor only the columns their response mapping actually reads, instead of fetching the full row. These are the two highest-traffic queries inpolicy.service.ts; I did not audit every Prisma call in the file for this PR (see note below).[bug] Graceful shutdown does not drain in-flight webhook deliveries #777 — Every webhook delivery is fired without being awaited by its caller (deliberately, per the existing
#493comment, so delivery never delays the request). That meant nothing was tracking them, so SIGTERM could abort a delivery mid-retry.WebhooksServicenow tracks in-flight deliveries in aSetand drains them inonApplicationShutdown, bounded by a configurableWEBHOOK_SHUTDOWN_DRAIN_TIMEOUT_MS(default 10s). Deliveries still pending at the timeout are logged with enough detail to replay manually — not auto-requeued, since there's no persistent delivery-log table to resume them from yet (would be a separate, larger change).[bug] PolicyController does not filter sensitive fields in list responses #758 — Investigated thoroughly: every
PolicyControllerlist/detail endpoint already returns a manually-constructed, narrow object (PolicySummary/ProductSummary), not a raw Prisma row —getUserPolicies,searchPolicies,getActiveProducts,getPolicy, the CSV export, and all admin product mutations all map through this. The Prisma schema also has no "internal notes" or "audit data" columns onPolicy/Productas the issue describes. I could not reproduce a current leak; closing via this PR per the usual workflow, but flagging in case I've missed a path — happy to reopen with specifics.[bug] Claims evidence upload does not enforce per-file size limit #778 — Investigated: there is no actual file-upload endpoint anywhere in this codebase yet (no multer, no
@UploadedFile/@UploadedFiles, nothing inclaims.controller.ts/SubmitClaimDto).evidence-validation.tsalready has correct per-file size + magic-byte validation (MAX_EVIDENCE_FILE_SIZE), it's just never called from anywhere — it's dead code waiting on an upload endpoint that doesn't exist yet. Building that endpoint from scratch is a real feature, not a fix to an existing one, so out of scope here; closing via this PR, but it may be worth re-scoping as a feature request instead.Separately, unrelated to these 4 issues
While reading
policy.service.tsI noticed it has two methods both namedfindAll(one around line 749, one around line 1196, identical signatures) — this should be a TypeScript duplicate-function-implementation compile error. Not touching it here since it's outside scope, but flagging for visibility.Test plan
No
npm installwas run for this change (environment constraint) — please runnpm run lint,npm run typecheck, andnpm testas part of review. I did not add new tests for #757 (query results are unchanged in shape, only columns fetched) or write a benchmark; both are listed acceptance criteria I did not exercise.Closes #757
Closes #758
Closes #777
Closes #778