Repository navigation
zero-swift: unregistered mutators fail instead of crashing; unnamed-query warning; docs and CLI help - #16
Merged
Conversation
Calling a mutator that isn't registered with the Zero hit a preconditionFailure. JS throws an Error with the same message. `mutate` now logs the message as an error and returns a MutatorResult whose client and server outcomes are both `.zeroError` with it, before looking at the connection (as JS checks registration first). Nothing is written locally and nothing is pushed. Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859 Co-authored-by: tmm <tmm@tmm.dev>
…g calls Behavior is unchanged and matches JS: when a client closes, by close() or because Zero replaced it, its pending `run` and a preload's pending `cached` and `complete` reject with a QueryError saying Zero was closed (QueryManager.handleClosed, as in JS). A run on an already-closed Zero that waits for .complete or .cached never returns. The `run` and `preload` docs and JSParity now say so. Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859 Co-authored-by: tmm <tmm@tmm.dev>
An unnamed query only sees local data, as in JS without enableLegacyQueries, so `run(query, type: .complete)` (or `.cached`) on one never returns and preloading one does nothing. That stays, but the client now logs a warning once per query hash (per client) that explains it and suggests a named query (defineQuery / QueryRequest). The `run` and `preload` docs and JSParity say so. Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859 Co-authored-by: tmm <tmm@tmm.dev>
incur 0.7.1 prints example options as `--<schema key> <value>`, with no kebab-casing and a value even for a boolean, so the help showed `--schemaFile shared/schema.ts` and `--check true`. Both happen to parse (camelCase keys are accepted and the stray `true` is ignored), but the documented forms are `--schema-file` and a bare `--check`. The two examples are gone; the codegen help keeps the plain example, points to GettingStarted.md, and shows the right forms in its hint. Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859 Co-authored-by: tmm <tmm@tmm.dev>
tmm
force-pushed
the
swift-parked-decisions
branch
from
October 22, 2026 06:34
8d67f27 to
3c933b9
Compare
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.
Four parked decisions from the bug sweep. Releases as a patch, after 0.4.0.
preconditionFailure, both the client and server outcomes are a.zeroErrorwith JS's message (Mutator "x" is not registered. …). It's logged as an error, nothing is written or pushed, and the check runs before the connection check, as in JS. A regression test is inClientAPITests.runone waiting for.complete/.cachedor preload one, since that never settles. It points to named queries.runand preload calls, in theZeroClientdoc comments and JSParity.md. No behavior change.--schemaFileand--check true. The misleading examples are removed, the correct forms (--schema-file, bare--check) are in the hint, and the description points to GettingStarted.md.Tested:
swift test(196 tests),swift format lint --strict, ClientE2ETests (2), the zbugs-swift build, and zero-swift-cli vitest (25), tsc, oxlint and oxfmt.