Repository navigation
release: 2.1.0 - #112
release: 2.1.0#112
Conversation
Use a colon, a comma or a new sentence instead, matching the house style for prose. Mechanical change: 59 lines, no wording changes otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const { isSuccess } = await remove({ id })` returned the reactive object
at once, before the request ended, and `isSuccess` was a ComputedRef,
always truthy, so the success branch also ran on failed requests.
The value returned by the three actions is now a PromiseLike, like
VueUse's useFetch. Awaiting it settles on the execution started by the
call and resolves to the plain snapshot `execute()` resolves to. It never
rejects, resolves at once to the current snapshot when the call starts no
execution (`immediate: false`, or `executeWhen` false), and never starts
a request itself, so thenable assimilation cannot run an action twice.
The template refs of the provider components stay non thenable.
Fixes found while making those guarantees hold:
- a read joining an in-flight request with the same params rejected when
that request failed, lost the shared error, and reported an aborted
shared request as not aborted;
- a request that could not be built (a missing path parameter) made
`execute()` reject and left the query idle;
- actions are now cleaned up when their effect scope is disposed, and an
action awaited outside any scope (an event handler) releases its query
once it settles, unless `keepAlive`; such queries used to stay in the
store for ever.
Code that awaited an action and then used its refs now gets plain
values: see the migration note in the CHANGELOG.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SonarCloud rule S7739 flags any object with a `then` property, which failed the quality gate on reliability. The awaitable is intentional, and the rule exempts a `then` member of a class that declares `implements PromiseLike`: move `then` into such a class so the intent is stated in the code instead of suppressed. `then` stays an own arrow function field, so destructuring, spreading and reactive proxies keep working, and the public types are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prefer `toHaveLength()` and `toBeUndefined()` over generic `toBe()` assertions for clearer failure reports (SonarCloud S5906). Only the lines added by this branch; existing tests are left as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
S7739 exempts a `then` field declared by a class that implements PromiseLike, but still flagged the `this.then = ...` assignment in the constructor. Initialize the field directly and keep its state in `#` private fields, which stay out of the object the action returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat: make read, submit and remove awaitable
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SonarCloud rule S9383 (floating promises) flags the eight `execute()` and `resubmit()` calls made by the autoExecute, executeWhen, window focus and document visibility handlers, and fails the quality gate of the release PR. They are fire and forget by design, and `execute()` never rejects: a failure lands in the query state. Mark them with `void`, as the rule suggests for promises that cannot practically reject. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Minor/patch bumps: @types/node, eslint, unplugin-dts, vite and vitest; packageManager pnpm@12.4.2 -> pnpm@12.8.1. Held back on purpose: - typescript stays at 6.0.3: TS 7 drops the JavaScript Compiler API until 7.1, which breaks declaration emit in unplugin-dts; - vitest resolves to 5.0.2, not 5.0.3: 5.0.3 was published a few hours ago and pnpm's one-day minimum release age applies; the next update picks it up. No newly locked package version is younger than one day. The emitted .d.ts files are byte for byte identical to the ones before the update. Type-check, lint, the 81 unit tests and the build all pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chore: update dependencies (2026-09-30) and mark fire and forget executions
|



Release 2.1.0
Awaitable actions, plus the fixes needed to make their guarantees hold (#110).
Added
read(),submit()andremove()return an awaitable object (aPromiseLike, like VueUse'suseFetch).const { isSuccess } = await remove({ id })now waits for the request and gives plain booleans. Before,awaitreturned the reactive object at once andisSuccesswas aComputedRef, always truthy, so the success branch also ran on failed requests.autoExecute), resolves at once to the current snapshot when the call starts no execution, and never starts a request itself.Changed
effectScope()and Pinia setup stores are now covered too.Fix
execute()reject: the query gets the error.read()joining an in-flight request no longer rejects when that request fails, keeps the shared error, and reports an aborted shared request asaborted: true.Notes
Minor bump because the API change is additive; the one behavior change for existing code is documented under "Changed". Known limitation, tracked in #111: re-executing a query can abort a request that belongs to another query.
The skill files also drop em and en dashes (docs only).
See
CHANGELOG.mdfor the full[2.1.0]entry.🤖 Generated with Claude Code