Skip to content

Fix web build: broaden isDeleteQueued type guard#78

Merged
SiteRelEnby merged 1 commit into
mainfrom
fix-delete-result-type
May 25, 2026
Merged

Fix web build: broaden isDeleteQueued type guard#78
SiteRelEnby merged 1 commit into
mainfrom
fix-delete-result-type

Conversation

@SiteRelEnby
Copy link
Copy Markdown
Contributor

@SiteRelEnby SiteRelEnby commented May 25, 2026

Summary

main is red: the web build (tsc -b) fails since #76 merged.

src/components/settings/uploaded-files-card.tsx(79,26): error TS2345:
Argument of type 'DeleteQueued | FileDeleted' is not assignable to
parameter of type 'DeleteResult'.

The file-delete mutation returns FileDeleted | DeleteQueued, but isDeleteQueued only accepted DeleteResult (void | DeleteQueued), so FileDeleted isn't assignable. Widen the guard's parameter to unknown - it already narrows via the pending_action_id check, and every existing DeleteResult caller still type-checks.

Why it slipped through

The local check script runs tsc --noEmit, which doesn't fully resolve project references the way CI's tsc -b does, so it didn't surface the error. Verified this fix with tsc -b, eslint, and a full npm run build (all green).

Migrations

None.

The file-delete mutation returns FileDeleted | DeleteQueued, but
isDeleteQueued only accepted DeleteResult (void | DeleteQueued), so
uploaded-files-card failed to type-check under tsc -b (FileDeleted not
assignable to DeleteResult), breaking the web build. Widen the guard's
parameter to unknown; it already narrows via the pending_action_id
check, and all existing DeleteResult callers still work.
@SiteRelEnby SiteRelEnby merged commit 39772a9 into main May 25, 2026
4 checks passed
@SiteRelEnby SiteRelEnby deleted the fix-delete-result-type branch May 25, 2026 19:33
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