Error Loop BIT-32038: TypeError: undefined is not an object (evaluating 'i.files.filter') in the desktop app, ERRSIG eec983840d8b / ERRCLUSTER 97bbf4a605ce.
Root cause
useUsbCamera's auto-ingest effect (added today in #141/#143, the USB card-list feature) reads status.files.filter(...) directly, guarded only by status?.tether. The Rust side always serializes files as an array, but nothing on the TS/IPC boundary enforces that invariant at runtime, so a status payload missing files crashes the passive-effects flush with the reported TypeError — matching the deeply recursive ky/wa React commit-phase stack in the report.
The render path in UsbCameraButton already defends this with status?.files ?? []; the auto-ingest effect did not.
Fix
Default to [] the same way the render path does, in apps/app/src/library/UsbCamera.tsx.
Testing
Added a regression test that reproduces the exact crash (status with tether: true but no files) and confirmed it throws on the pre-fix code and passes after the fix. Full UsbCamera.test.tsx suite (6 tests) passes.
Error Loop BIT-32038: `TypeError: undefined is not an object (evaluating 'i.files.filter')` in the desktop app, ERRSIG `eec983840d8b` / ERRCLUSTER `97bbf4a605ce`.
## Root cause
`useUsbCamera`'s auto-ingest effect (added today in #141/#143, the USB card-list feature) reads `status.files.filter(...)` directly, guarded only by `status?.tether`. The Rust side always serializes `files` as an array, but nothing on the TS/IPC boundary enforces that invariant at runtime, so a status payload missing `files` crashes the passive-effects flush with the reported TypeError — matching the deeply recursive `ky`/`wa` React commit-phase stack in the report.
The render path in `UsbCameraButton` already defends this with `status?.files ?? []`; the auto-ingest effect did not.
## Fix
Default to `[]` the same way the render path does, in `apps/app/src/library/UsbCamera.tsx`.
## Testing
Added a regression test that reproduces the exact crash (status with `tether: true` but no `files`) and confirmed it throws on the pre-fix code and passes after the fix. Full `UsbCamera.test.tsx` suite (6 tests) passes.
The auto-ingest effect in useUsbCamera read status.files.filter directly,
guarded only by status?.tether. The Rust side always serializes files as
an array, but nothing on the TS side enforces that invariant on the IPC
boundary, and a status shape missing files (e.g. a stale/partial Tauri
response) crashed with "undefined is not an object (evaluating
'i.files.filter')" during the passive-effects flush, matching the
desktop error loop report. Default to an empty array like the render
path at UsbCameraButton already does.
Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8)
Paperclip-Issue: BIT-32038
Paperclip-Run: 68339729-e8a7-47bb-ac2b-20ba0f3189dd
spark
merged commit fbdc728ae7 into main2026-11-03 12:30:05 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Error Loop BIT-32038:
TypeError: undefined is not an object (evaluating 'i.files.filter')in the desktop app, ERRSIGeec983840d8b/ ERRCLUSTER97bbf4a605ce.Root cause
useUsbCamera's auto-ingest effect (added today in #141/#143, the USB card-list feature) readsstatus.files.filter(...)directly, guarded only bystatus?.tether. The Rust side always serializesfilesas an array, but nothing on the TS/IPC boundary enforces that invariant at runtime, so a status payload missingfilescrashes the passive-effects flush with the reported TypeError — matching the deeply recursiveky/waReact commit-phase stack in the report.The render path in
UsbCameraButtonalready defends this withstatus?.files ?? []; the auto-ingest effect did not.Fix
Default to
[]the same way the render path does, inapps/app/src/library/UsbCamera.tsx.Testing
Added a regression test that reproduces the exact crash (status with
tether: truebut nofiles) and confirmed it throws on the pre-fix code and passes after the fix. FullUsbCamera.test.tsxsuite (6 tests) passes.