Skip to content

fix: audit bug fixes — capture cleanup, collection isolation, MCP error handling, Vue/React reactivity - #281

Merged
vamgan merged 7 commits into
mainfrom
claude/create-agents-md-fqfEf
Jun 1, 2026
Merged

vamgan merged 7 commits into
mainfrom
claude/create-agents-md-fqfEf

Conversation

@vamgan

@vamgan vamgan commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes for all bugs identified during the fresh codebase audit (#267–#279).

Fixes included

fix(core): clean up capture overlay before invoking onCapture — closes #276
Moves removeOverlay() before the onCapture callback so any error thrown inside it cannot leave a stale overlay mounted in the DOM.

fix(core): isolate per-item sanitizeItem failures in collection sources — closes #275
Replaces Promise.all with Promise.allSettled (+ async wrapper for sync throws) in collectionItemsResult. A single failing sanitizeItem no longer rejects the entire collection — failing items are omitted, healthy items still resolve.

fix(mcp): error handling in tool handlers and tighten Zod schema — closes #272, #273

  • get_current_context and format_context_for_prompt handlers now return isError: true on provider failure instead of crashing the server process.
  • Removes .passthrough() from the sources array item schema so unrecognised fields are stripped before reaching the provider.

fix(vue): make useAskableSource enabled option reactive — closes #268
enabled now accepts MaybeRef<boolean> and uses watch({ immediate: true }) to register/unregister the source whenever the value changes.

fix(react): stale closures in useAskableRegionCapture and AskableInspector — closes #269, #270

  • useAskableRegionCapture: onCapture/onCancel now always read from optionsRef.current at call time.
  • AskableInspector: inspector options stabilised with useMemo keyed on the individual scalar fields, satisfying exhaustive-deps.

Previously committed on this branch:

Test plan

  • npm test --workspace=packages/core — 181 tests pass
  • npm test --workspace=packages/vue — 39 tests pass (includes new reactive enabled ref test)
  • npm test --workspace=packages/react — 52 tests pass
  • npm test --workspace=packages/mcp — 5 tests pass
  • npm test --workspace=packages/svelte — 35 tests pass

Generated by Claude Code

claude added 7 commits June 1, 2026 05:38
…eardown

- core: push() now applies sanitizeText/sanitizeMeta to ancestor segments
  and calls sanitizeText even when text is undefined (fixes #247, #248)
- core: validate maxHistory is a non-negative integer in constructor (fixes #254)
- core: guard a11yTextExtractor aria-labelledby lookup against missing
  document in non-browser environments (fixes #257)
- react-native: useAskableVisibility and useAskableScrollView now capture
  context ownership at creation time so cleanup always destroys the right
  context regardless of later prop changes (fixes #250)
- svelte: useAskable.svelte.ts registers focus/clear listeners inside
  $effect so they are removed when the component unmounts (fixes #252)
- svelte, vue: remove wildcard @askable-ui/core from devDependencies (fixes #262)
Moves removeOverlay / state reset before the onCapture call so that
any error thrown inside the callback cannot leave a stale overlay in
the DOM. Adds a regression test that asserts the overlay is already
absent from the DOM by the time onCapture fires.
Replaces Promise.all with Promise.allSettled (plus an async wrapper to
capture synchronous throws) so a single failing sanitizeItem does not
reject the entire collection. Failed items are omitted from the result
while all healthy items still resolve. Adds tests for both synchronous
throw and async rejection isolation.
- Wrap get_current_context and format_context_for_prompt handlers in
  try/catch so a provider error returns isError:true instead of
  crashing the MCP server process.
- Remove .passthrough() from the sources array item schema so
  unrecognised fields are stripped rather than forwarded to the
  provider without validation.
The previous implementation evaluated enabled once at setup time so
toggling it later had no effect. Now accepts MaybeRef<boolean> and
uses watch({ immediate: true }) to register or unregister the source
whenever the value changes. Adds a test that toggles a ref from false
to true and back.
…Inspector

useAskableRegionCapture: onCapture and onCancel callbacks captured the
options object at start() call time. Any callback change between start()
and the pointer-up event would be silently ignored. Now always reads
from optionsRef.current so the most-recent callback fires.

AskableInspector: inspectorOptions was used inside useEffect but only
individual scalar fields were listed in the deps array. Stabilise the
options object with useMemo keyed on the same scalars so the effect dep
is a single stable reference and exhaustive-deps is satisfied.
@vercel

vercel Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
askable Ready Ready Preview, Comment Jun 1, 2026 5:57am

@vamgan
vamgan merged commit 0d77701 into main Jun 1, 2026
7 of 8 checks passed

This branch was successfully deployed

1 active deployment
Preview — 98e5c31e Deployed Jun 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment