Repository navigation
build(deps): bump ky from 1.12.0 to 2.2.0 - #2260
dependabot[bot] wants to merge 1 commit into
Conversation
49e6f03 to
52b1dac
Compare
|
@dependabot rebase |
b9799dc to
e2882b1
Compare
7788b82 to
1e495bb
Compare
|
@dependabot rebase |
1169674 to
0730c50
Compare
|
@dependabot rebase |
0730c50 to
85c22b9
Compare
|
@dependabot rebase |
85c22b9 to
41fabdd
Compare
|
@dependabot rebase |
41fabdd to
3a32db5
Compare
|
@dependabot rebase |
3a32db5 to
624feb7
Compare
|
@dependabot rebase |
Bumps [ky](https://github.com/sindresorhus/ky) from 1.12.0 to 2.2.0. - [Release notes](https://github.com/sindresorhus/ky/releases) - [Commits](sindresorhus/ky@v1.12.0...v2.2.0) --- updated-dependencies: - dependency-name: ky dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
624feb7 to
5d1c2de
Compare
Review:
|
| Change | Affects us? |
|---|---|
prefixUrl renamed to prefix (#606). Since 2.2.0 options are validated, so passing prefixUrl rejects every request with "The prefixUrl option has been renamed prefix…" (3ded2aa). |
🔴 Yes, blocking. Without the fix not a single request leaves the browser, so login, simulations and results are all broken. |
Hooks get a single state object ({request, options, response, retryCount}) instead of positional args (#827). |
🔴 Yes. Our 3-arg afterResponse hook fails tsc with TS2322 (AuthService.tsx:115), so npm run build fails and CI on this PR will be red. If the type error were ignored, response would be undefined and no error snackbar would ever show. |
Errors thrown or rejected in afterResponse are now fatal, not retried (#834). |
🟠 Yes, subtle. Our hook rejects on every error status. In v1 that rejection went through ky's retry loop, so a failing GET/DELETE was attempted 3× (at 0 / +0.3 s / +0.9 s) and showed up to 3 snackbars. v2 makes 1 attempt and shows 1 snackbar. That is a behavior and UI change, so the fix restores the v1 behavior with ky.retry(). |
.json() throws on empty bodies and 204 (#854); parseJson now also receives empty strings (#877). |
🟠 Potentially. v1 returned '' for an empty successful response, v2 would throw SyntaxError from our JSON.parse. The fix returns '' for an empty 2xx body, as before. |
searchParams are merged with an existing query string instead of replacing it (#840). |
🟢 No. None of our inputs contains ?, and the generated URLs are byte-identical. |
Network failures throw the new NetworkError instead of TypeError (#842). |
🟢 No UI impact: we never check the error class. Only the console.error text changes (RemoteWorkerSimulationService.ts:355, :555). |
beforeError gets all error types; Ky-specific options are stripped from the options passed to hooks. |
🟢 No. We don't use beforeError, and the hook only reads options.retry, which is still there. |
New features: baseUrl, totalTimeout, maxResponseSize, init hook, HTTPError.data, Standard Schema, QUERY method, ky.retry() (1.14). |
🟢 Not used, except ky.retry() in the fix. |
Many fixes for aborts, timeouts, .extend() option merging and progress events. |
🟢 None changes our paths: signal, timeout: 30000 and .extend({retry: 0}) behave identically (tested). |
| Requires Node ≥ 22. | 🟢 We use 24 (engines, Dockerfile node:24, CI 24.x). |
| Security / CVE | None mentioned in any release note. |
| CSS / markup | None: ky has no UI. |
| Bundle | Main chunk +21.8 kB raw / +7.2 kB gzip (~+0.4%). |
Proposed fix (src/services/AuthService.tsx only)
prefixUrl: backendUrl→prefix: backendUrl. It builds the same URL for a base URL with a trailing slash, without one, and with a subpath.- The hook signature becomes
async ({ request, options, response, retryCount }) => …. The hook body is unchanged, just wrapped intry/catch. - In
catch: if the method is retriable (options.retry.methods) andretryCount < options.retry.limit, returnky.retry(); otherwise rethrow the original error (the sameResponseas v1). This reproduces v1's retry count, delays (300/600 ms) and snackbars. Theretry: 0instance still makes a single attempt. parseJson(text, { response }): iftext === ''andresponse.ok, return''(v1 behavior). Empty error bodies still throw, as in v1.
Verification
| master | bump as-is | bump + fix | |
|---|---|---|---|
tsc --noEmit |
baseline | +4 errors | no new errors |
CI=true npm test (39) (flaky) |
36 ✅ / 2 ❌ | 35 ✅ / 3 ❌ | 35 ✅ / 3 ❌ |
npm run build |
✅ | ❌ TS2322 | ✅, same warnings |
- Jest failures are environmental and not from the bump: the
ShieldhitConverterfixture lives in a missing submodule, and the two Selenium tests hit whatever runs on:3000. No test importsky. - Node harness running our exact
ky.createconfig with v1.12.0 and with v2.2.0 + fix against a local server: 59 scenarios identical. Covered: URLs (3 base URL forms), query params, JSON body,Authorizationheader, snake→camel parsing, 400/401/403/500/503 (attempt count and snackbars), 204 and empty body, abort, timeout, network down,retry: 0. The only difference is theTypeError→NetworkErrorclass name. - Manual UI diff vs master (production builds against a mock yaptide backend, plus demo mode): login ok and failed, "Connected" indicator, simulations list, results (JSROOT 1D/2D), submit rejected (400), delete failing (500: 3 attempts and 3 snackbars on both), examples, 3D editor, save dialog, converter output (identical text hash), light and dark theme, 375 px width. No visual or functional differences. The backend received the same requests (method, path, query, status) from both versions.
- Bump without the fix (forced build): login with valid credentials shows only "Login failed.", and the backend receives 0 requests.
Backend testing
The fix guarantees the backend receives exactly the same requests as from master, so no backend change is needed. Before merging, it's still worth a ~5-minute smoke test on dev/staging with the real backend, because this code path carries all backend traffic and the mock can't reproduce every real response:
- log in and out (local account; Keycloak/PLGrid if available)
- "Connected" indicator, and staying logged in for >3 min (token refresh)
- simulations list loads; open results (1D + 2D plots)
- submit a simulation; cancel or delete one
- wrong password shows the backend message in a snackbar, as on master
Bumps ky from 1.12.0 to 2.2.0.
Release notes
Sourced from ky's releases.
... (truncated)
Commits
35418882.2.0242c327Let abeforeRetryhook change per-attempt optionsd9ddb03Fix CId93adf8Run the browser tests and static checks once in CIa5ed57bRefactor7f0137dReport the sent request for a hook's response, and finish the cross-realm and...13c8da5Stop surfacing progress callback errors55599c8RunbeforeErrorfor abeforeRetryabort and share the body-wrapping check3ded2aaTweaks692c435Restore the retry-only marker condition and cover the remaining cases