Self-initiated engineering study
Browser debugging with repeatable checks.
A small diagnosis that makes one lifecycle failure observable. Run the comparison, inspect the ordered events, and see exactly what the test covers.
Inspect the cleanup comparisonMain technical exhibit
Async cleanup in Svelte 5.23.2
Loading the fixed Svelte bundle...
The two self-written components complete the same Promise step before resource creation. The harness mounts real Svelte components, waits for setup to finish, then unmounts them. A ControlledEventSource records close() calls without opening a network connection.
This button runs the local controlled test. It does not contact a service or change a production application.
Not run in this session.
Controlled resources and DOM
Values appear only after a run.
| Case | Stage | Created | Close calls | Unclosed | DOM state |
|---|
The runtime field live means an unclosed controlled object. It does not measure a live connection or retained memory. DOM entries show “mounted” after setup and whether removal occurred after unmount.
Real component mount target
The target is empty again after each completed destruction.
Lifecycle events and cleanup
Inspect the order, then the measured hooks.
No events recorded in this session.
The JSON report includes mounted-DOM presence, DOM removal, onDestroy hook counts, and returned-cleanup callback counts for each case.
Inspect the current JSON report
No report generated in this session.
Interpretation
One failure, a bounded comparison.
A current browser run is evidence of this test only.
What the comparison checks
An asynchronous onMount callback returns a Promise. This study compares it with a synchronous callback that returns a cleanup function. Both complete their setup before the harness requests unmount.
The report checks real component destruction alongside controlled close() calls. The table and JSON contain observed results from the current run, rather than a saved success result.
The synchronous control is not a complete production fix: if destruction occurs while setup is pending, cleanup can run before the resource has been assigned. That timing is not tested here.
What remains outside this test
- Real HTTP or SSE traffic, reconnect behavior, and network teardown.
- Memory retention or a measured memory leak.
- Unmount while asynchronous setup is still pending.
- Production-application acceptance or a delivered client repair.
Inspect the component source
These self-written components are used by the comparison. The synchronous source is a setup-complete-only control, not a complete production patch; unmount during pending setup is untested.
This is an original, self-initiated minimal diagnosis. It is not a customer commission, testimonial, or paid project result.