Files
PaperClipAI/ui
48025caaca fix(ui): mark the connectivity probe's timeout abort as intentional (#22390)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The browser UI shows a connection banner. It checks the server with
a health probe (`probeServerHealth` in `ui/src/lib/connectivity.ts`)
> - The probe stops its own `fetch` after 10 seconds with a reasonless
`controller.abort()`. The app catches that rejection
> - A `fetch` wrapper outside the app, such as a browser extension, can
drop the rejection. The browser then reports `AbortError: signal is
aborted without reason` as an unhandled rejection, and Sentry records an
error that has no user effect
> - #22090 added a marked abort reason for the shared GET and a Sentry
filter that drops only that marked object. The probe timeout did not use
it
> - This pull request makes the probe timeout abort with the same marked
reason
> - The benefit is that the probe's own timeout no longer shows as a
production error, and every other `AbortError` is still reported

## Linked Issues or Issue Description

No public issue exists. This is the problem, in the bug template fields:

**What happened?**
A hosted browser reported one unhandled rejection: `AbortError: signal
is aborted without reason` (DOMException code 20, mechanism
`onunhandledrejection`, native trusted promise). The stack is a
`setTimeout` callback in `probeServerHealth` that calls
`controller.abort()` on the `/api/health` probe. The tab was hidden and
had just resumed.

**Expected behavior**
The probe's own timeout does not appear in error monitoring. A real
abort failure still appears.

**Steps to reproduce**
1. Replace `window.fetch` with a wrapper that calls the real `fetch` and
attaches only `.then(() => {})` to its promise.
2. Make `/api/health` hang for more than 10 seconds.
3. The probe timeout aborts the request. The app's `try/catch` handles
its own promise, but the wrapper's derived promise rejects with no
handler.

**Paperclip version or commit**
Reported on release `651749bdb4`. `probeServerHealth` is unchanged on
master up to this branch's base (`201abacd6e`).

**Deployment mode**
Hosted, browser UI (Chrome-family message text).

Refs #22090 (same filter, shared GET call site) and #22380 (same
approach, announcement card). I searched open PRs for
`probeServerHealth` and `intentionalAbortReason` and found no duplicate
for this call site.

## What Changed

- `ui/src/lib/connectivity.ts`: the probe timeout calls
`controller.abort(intentionalAbortReason())` instead of
`controller.abort()`.
- `ui/src/lib/connectivity.test.ts`: a new test uses a `fetch` that
settles only when its signal aborts. It checks that the probe returns `{
reachable: false }` after 10 seconds and that the signal reason is the
marked intentional reason.

## Verification

- `cd ui && npx vitest run src/lib/connectivity.test.ts
src/lib/sentry.test.ts src/api/client.test.ts` → 3 files, 80 tests pass.
- Red check: without the `connectivity.ts` change, the new test fails
(`isIntentionalAbortReason(signal.reason)` is `false`).
- `cd ui && npx vitest related src/lib/connectivity.ts --run` → 346 of
347 files pass. The 2 failures in
`src/components/Layout.viewport.test.tsx` also fail on unmodified
`master` in this sandbox, so this change does not cause them.
- `tsc --noEmit` for `ui` reports no errors in the changed files.
- The existing real-SDK tests in `ui/src/lib/sentry.test.ts` (from
#22090) prove that `beforeSend` drops a marked rejection and still sends
an unmarked `AbortError`.

## Risks

- Low risk. The filter matches by object identity, and only
`intentionalAbortReason()` makes these objects. An `AbortError` from any
other source is still reported.
- The probe's abort message changes from the browser's text to "The
operation was aborted.". The probe catches every rejection and does not
read the message.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

- Claude Opus 5.5 (Anthropic), model ID `claude-opus-5-5`, used through
Claude Code with tool use (shell, file edits, test runs).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: paperclipbugbot <356415228+paperclipbugbot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:52:50 -08:00
..
…

@paperclipai/ui

Published static assets for the Paperclip board UI.

What gets published

The npm package contains the production build under dist/. It does not ship the UI source tree or workspace-only dependencies.

Storybook

Storybook config, stories, and fixtures live under ui/storybook/.

pnpm --filter @paperclipai/ui storybook
pnpm --filter @paperclipai/ui build-storybook

Typical use

Install the package, then serve or copy the built files from node_modules/@paperclipai/ui/dist.

Editor dependency identity

Keep the root and workspace overrides for @codemirror/state, @codemirror/view, and @lezer/common aligned. CodeMirror requires shared extension identity, while Lezer parsers and syntax highlighters require shared NodeProp IDs. Multiple Lezer copies can crash code-block highlighting with tags is not iterable. src/lib/codemirror-single-instance.test.ts checks the installed dependency graph and highlights sample code through the editor's real language dependencies. GitHub Actions owns regeneration of pnpm-lock.yaml.