Skip to content

Scrub uploader email after delivery - #20

Merged
Cry0nicS merged 3 commits into
mainfrom
scrub-uploader-email-after-delivery
Aug 3, 2026
Merged

Cry0nicS merged 3 commits into
mainfrom
scrub-uploader-email-after-delivery

Conversation

@Cry0nicS

@Cry0nicS Cry0nicS commented Aug 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

parseMultipartUpload awaits mkdir before entering the promise executor that captures its start time and
creates the watchdog interval, and advanceTimersByTimeAsync does not wait for filesystem I/O — so a test
that advanced fake time straight after calling it could run its whole trickle loop while that mkdir was
still pending, leaving the interval installed after the last advancement with nothing left to move the
clock and the rejection pending forever.
All three streaming tests now wait on a fileBegin barrier first, which formidable can only report from
inside form.parse and therefore proves the interval is live and the start time is pinned to fake-time
zero; raising the Vitest timeout would not have helped, since the interval needs time advanced rather
than more real time waited.
The steady-upload test needed a second barrier: it asserts that neither bound fires, which is the one
assertion that depends on the byte counter keeping pace with the clock, and it had only been passing
because the watchdog installed too late to evaluate the rate floor at all.
It now pushes its payload and confirms the request buffer has drained before letting time cross the
grace period, stepping the clock in small increments because Node pumps stream reads through
setImmediate, which the fake timers replace.
Measured under CPU saturation over 40 runs: the original failed 5 times in 30, the barrier alone moved
the failure to the steady test at 10 in 40, and this version failed 0 in 40.
…n comment

pumpUntilConsumed could throw after its final advancement even when that step drained the buffer.
It now checks readableLength once more before failing.
The fileBegin comment claimed formidable reports the event when it starts writing the file.
It actually fires once the part headers are parsed, immediately before file.open().
The extra body byte stays: measured under CPU saturation, removing it made the steady-upload drain
overrun its step budget in 6 of 38 runs, against zero in 55 runs with it kept.
formidable emits fileBegin immediately before opening the file, not after, so the reported temp
path can refer to a file that does not exist on disk yet.
@Cry0nicS
Cry0nicS force-pushed the scrub-uploader-email-after-delivery branch from 44bbedb to 76b6907 Compare August 3, 2026 20:00
@Cry0nicS
Cry0nicS enabled auto-merge (rebase) August 3, 2026 20:01
@Cry0nicS
Cry0nicS merged commit 64771b8 into main Aug 3, 2026
9 checks passed
@Cry0nicS
Cry0nicS deleted the scrub-uploader-email-after-delivery branch August 3, 2026 20:05
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.

1 participant