Delete three modules nothing outside their own tests imported - #246
Closed
droplister wants to merge 1 commit into
Closed
Delete three modules nothing outside their own tests imported#246droplister wants to merge 1 commit into
droplister wants to merge 1 commit into
Conversation
Each was reachable only from its own test file, which is what kept them out of the earlier dead-code sweep: that pass counted any importer, and a test counts. A module whose only consumer is its own test is not in the product. validation/qrCode.ts (391 lines) sanitised scanned QR input - XSS, protocol and path-traversal checks. The wallet has no scanner: components/ui/qr-code.tsx only generates QR codes onto a canvas. It validated an input that never arrives. services/core/RequestManager.ts (338 lines) is superseded by approvalService and the request storage modules. components/ui/cards/address-card.tsx (42 lines) has no reference of any kind - no import, no dynamic import, no barrel. Not deleted, and left for their own change: validation/csv.ts and validation/file.ts are also unreferenced, but each is the better implementation of something a caller now does inline and less carefully. Removing them would delete the good version and keep the weak one. Claude-Session: https://claude.ai/code/session_01CcjnCrgosSeshymXLBxdGj
This was referenced Aug 4, 2026
Member
Author
|
Squashed into #249. |
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.
Stacked on #245.
Each was reachable only from its own test file — which is why the earlier dead-code sweep missed them. That pass counted any importer, and a test counts. A module whose only consumer is its own test isn't in the product.
core/validation/qrCode.tsservices/core/RequestManager.tsapprovalService+ request storagecomponents/ui/cards/address-card.tsx2,312 lines removed including tests.
The QR one is worth a note
qrCode.tsdid XSS, protocol and path-traversal checks on scanned QR text. Butcomponents/ui/qr-code.tsxonly generates QR codes onto a canvas — there is no scanner and no untrusted QR input path.So AUDIT.md line 199 claims a control that guards an attack surface that doesn't exist: "QR code sanitization | XSS, protocol, path traversal protection" as ✅ implemented. That's the opposite of the understatement fixed in #242, and worth correcting separately.
Deliberately not deleted
core/validation/csv.ts(294) andcore/validation/file.ts(382) are also unreferenced — but each is the better implementation of something a caller now does inline and less carefully:csv.tshasdetectCSVInjection, a row cap, address validation and a real quoted-value parser.pages/compose/send/mpma/form.tsxhand-rolls a regex parser with no injection check and no row bound.file.tshasvalidateFileType,validateFileName,detectMaliciousContent.file-upload-input.tsxvalidates nothing ("let parent handle size checking"), andcompose/broadcast/form.tsxchecks size only, passing the browser-reportedfile.typestraight through asmime_type.Deleting these removes the good version and keeps the weak one. Wiring them up is a behaviour change on the MPMA send and inscription paths — inscriptions only started working in 0.7.0 — so it belongs in its own change with its own tests, not bundled with a deletion.
Verification
tsc --noEmitclean;biome check srcclean (672 files)vitest run src— 3963 passed, 49 skippedwxt buildsucceeds, bundle unchanged at 2.46 MB