Skip to content

fix(mods): count Chromium connection timeouts as lookup timeouts (#750) - #792

Open
Zaldaryon wants to merge 1 commit into
devfrom
fix/issue-750-mod-lookup-timeout
Open

Zaldaryon wants to merge 1 commit into
devfrom
fix/issue-750-mod-lookup-timeout

Conversation

@Zaldaryon

Copy link
Copy Markdown
Collaborator

Summary

When ModDB is unreachable because the connection hangs during CONNECT or TLS handshake, Chromium aborts with net::ERR_TIMED_OUT or net::ERR_CONNECTION_TIMED_OUT. Because useQueryMod previously matched only the internal "Network request timed out" message from the launcher's own timers, connection-level timeouts were treated as plain non-timeout failures. Consequently, lookupTimedOut never tripped in useGetCompleteInstalledMods or ImportModpackPopup, causing batches to continue querying through all subsequent 30-second waves and stalling Manage Mods for 95 seconds or more.

This change maps net::ERR_TIMED_OUT and net::ERR_CONNECTION_TIMED_OUT to "Network request timed out" in requestBoundedBuffer (src/ipc/network.ts), and also recognizes both codes directly alongside the timer message in useQueryMod (src/renderer/src/features/mods/hooks/useQueryMod.ts). Quick failures such as net::ERR_CONNECTION_REFUSED or net::ERR_NAME_NOT_RESOLVED continue to report timedOut: false so remaining mods in the batch are still checked.

Type

  • Bug fix
  • Feature
  • Performance
  • Refactor or cleanup
  • Tests only
  • Docs or build

Checklist

  • Targets dev, not main.
  • npm run typecheck passes.
  • npm run lint:ci passes.
  • npm run format:check passes.
  • npm run test:coverage passes, coverage at or above the floor in vitest.config.ts.
  • npm run build:unpack passes.

Testing

  1. Verified unit behavior in tests/renderer-dom/useQueryMod.test.tsx (11 tests passed), checking clean 200, 404 not-found, non-timeout errors, timer timeout, and Chromium connect timeouts (net::ERR_TIMED_OUT, net::ERR_CONNECTION_TIMED_OUT).
  2. Verified batch abort behavior in tests/renderer-dom/useGetCompleteInstalledMods.test.tsx (8 tests passed): verified that connect timeouts stop subsequent lookup waves at 2 requests, while quick connection refused failures permit all 6 requests to run.
  3. Verified modpack import abort behavior in tests/renderer-dom/importModpackPopup.test.tsx (28 tests passed): verified that connect timeouts stop subsequent modpack lookup requests.
  4. Verified IPC transport mapping in tests/ipc/moddb-slow-transfer-timeout.test.ts (9 tests passed): verified requestBoundedBuffer unifies net::ERR_TIMED_OUT and net::ERR_CONNECTION_TIMED_OUT as "Network request timed out" and preserves other error codes.
  5. All 5 repository gates passed:
    • npm run typecheck: clean
    • npm run lint:ci: 0 errors
    • npm run format:check: 100% compliant
    • npm run test:coverage: Statements 95.08%, Branches 91.30%, Functions 95.89%, Lines 97.03%
    • npm run build:unpack: Linux x64 unpacked build completed with 0 errors

Related issues

Fixes #750

When ModDB hangs during CONNECT or TLS handshake, Chromium aborts with
net::ERR_TIMED_OUT or net::ERR_CONNECTION_TIMED_OUT. Because useQueryMod
previously matched only the launcher's internal "Network request timed out"
timer string, connection timeouts did not flag timedOut. As a result,
Manage Mods and modpack import continued through all subsequent lookup
waves, stalling the UI for 95 seconds or more.

Map net::ERR_TIMED_OUT and net::ERR_CONNECTION_TIMED_OUT to "Network
request timed out" in requestBoundedBuffer, and recognize them alongside
the timer error in useQueryMod. Quick failures such as connection refused
or DNS resolution failure remain non-timeout failures so other installed
mods continue to be checked.

Fixes #750
@Zaldaryon
Zaldaryon requested a review from Pixnop October 27, 2026 14:32
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