breaking: error when a client-requested single-flight mutation isn't respected by the server, allow the server to explicitly ignore refreshes - #16892
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/025774c751fc41c33fc9aa75e90d7da24d04fe6eOpen in |
🦋 Changeset detectedLatest commit: 025774c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I investigated this failed test run and found that The primary test used a timing-sensitive server cleanup counter despite traces showing the form response and targeted reconnect succeeded; it is stabilized by asserting observable reconnect requests. The separate flaky batch retry arose from module-level todo state leaking across retries and is fixed by resetting that state before baseline assertions. I opened #16896 with a proposed fix. |
Change version of @sveltejs/kit from minor to major and update the feature description.
96d1afa to
8af3e89
Compare
Fixes two pre-existing async e2e flakes exposed by the CI run for #16892. The form reconnect test previously polled a server-side iterator cleanup counter. The failed traces show that the form response succeeded and the targeted `get_count` connection restarted, but transport cleanup had not updated the counter within the assertion window. Assert the observable reconnect requests directly instead, including that `get_finite_count` is not reconnected. The serial batch tests also retained module-level todo mutations across retries. Reset the todos before asserting the baseline state so reruns are idempotent. Failed workflow: https://github.com/sveltejs/kit/actions/runs/32541364509 Verification: - primary test: 100 dev repetitions and 100 build repetitions - batch mutation sequence: 40 tests - relevant dev tests with two workers: 120 tests - relevant build tests: 60 tests - `pnpm -F test-async check` - formatting and diff checks Co-authored-by: svelte-triage-bot <team@svelte.com>
closes #16839
Prior to the PR, client-requested single-flight mutations had a weird inconsistency. When calling
requested(query, limit), queries that exceededlimitwould be failed by the server -- the server would generate a failure response for each one of them and send it back to the client. However, ifrequestedwasn't called at all, we would just do... nothing. Your queries would just not refresh and you wouldn't know about it unless you happened to notice.In addition to the inconsistency, the design was silly. The error for a missed refresh is the same for every query. The client already knows which queries were requested. So the server doesn't need to send back information about them! The client can just diff its list of requested refreshes with the response!
This PR addresses the two issues:
ignore:If you just want to ignore a query altogether, there's a similar shorthand:
requested(...).ignoreAll().