Skip to content

Fix Tasks stale-label persistence test race - #2112

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-tasks-stale-label-preference-render-thr_ayy4adsskd
Aug 21, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-tasks-stale-label-preference-render-thr_ayy4adsskd

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

What was wrong

The stale-label persistence test waited only until the mock RPC handler recorded a listTasks invocation with empty labelIds. That recording happens synchronously at handler entry, before the response crosses the async query path and React commits the empty result, so a loaded CI runner could complete the wait while the prior unfiltered ALP-1 row was still in the DOM. This produced the exact failures seen in run 32429333291 and run 32429304373; the production stale-label behavior itself was correct.

What changed

Kept the RPC assertion that proves stale label names resolve to an active empty ID filter, then made the existing ALP-1 and ALP-2 absence assertions wait for the observable DOM result. This changes no production or wire behavior, does not increase a timeout, and does not weaken the assertions.

How you verified

  • Before the fix, a controlled 100 ms delay between the empty-filter RPC invocation and response reproduced the exact ALP-1 assertion failure. With the fix, the same controlled delay passed; the probe was then removed.
  • pnpm exec turbo run test --filter=bb-plugin-tasks --force -- --run views/list/list-preference.persistence.test.tsx — 7 passed.
  • 64 concurrent focused runs of the stale-label test — 64 passed, 0 failed.
  • pnpm exec turbo run test --filter=bb-plugin-tasks --force — 35 files and 359 tests passed.
  • pnpm exec turbo run typecheck --filter=bb-plugin-tasks --force — passed with the plugin SDK type-generation dependency.
  • pnpm exec turbo run build --filter=bb-plugin-tasks --force — passed with the plugin SDK build dependency.
  • git diff --check — passed.

AGENT GENERATED: by GPT-5.6-Sol

@ymichael
ymichael merged commit c9aef75 into main Aug 21, 2026
13 checks passed
@ymichael
ymichael deleted the bb/ci-flake-fix-tasks-stale-label-preference-render-thr_ayy4adsskd branch August 21, 2026 01:06
SawyerHood added a commit that referenced this pull request Aug 21, 2026
## What was wrong

The codebase carried a lot of code that nothing reached: symbols and
files with no consumer, options that no caller passes, branches the
types make impossible, feature flags that graduated but kept their `if`
guards, pass-through wrappers that only forward arguments, barrel files
that re-export hundreds of names nobody imports through them, and the
same small helper copied into many files. This code has no effect on
behavior, but every reader must still parse it.

## What changed

Net −16k lines across 1,732 files. No behavior change. Four commits, two
per pass:

1. **Remove dead code, pass-through wrappers, and stale barrels** —
unused symbols and files, dead branches, unused params/options,
single-use wrappers inlined, dead barrel lines, tests and stories that
existed only for deleted code. Drops the unused `cronstrue` dependency
from `apps/app`.
2. **Drop export from module-private symbols** — ~900 declarations that
were exported but only used inside their own file.
3. **Remove more dead code, duplicate helpers, and unused options** —
second pass over the same ground plus repo-wide sweeps for duplicate
helpers and legacy/compat paths. Folds byte-identical helper copies into
one shared module where the consumer already depends on it (e.g.
`describeError` ×11, `createDeferred` ×15 → `@bb/test-helpers`,
`DelayedLoading` ×4 → `@bb/shared-ui`). Removes unused
`ws`/`@types/ws`/`tsx` devDependencies from `apps/connect` and an unused
`@radix-ui/react-slot` from `apps/web`.
4. **Drop export from more module-private symbols** — ~700 more.

Out of scope on purpose: `@get-bb/plugin-sdk` and `@bb/sdk` exports
(public API), CLI commands and flags, server routes, DB schema and
migrations, generated code, wire payload shapes between the server and
host daemon (`HOST_DAEMON_PROTOCOL_VERSION` is unchanged), and parsers
for persisted or legacy data.

Every removal was found by one agent, adversarially verified by a second
agent that searched the whole repo (including strings, configs, docs,
`.ladle`, and stories) for any remaining reference, and then applied by
a third. 41 proposals were rejected at verification or apply time, and I
reverted 2 more by hand.

## How you verified

- `pnpm exec turbo run typecheck` — 74/74 packages pass
- `pnpm exec turbo run lint` — passes
- `pnpm exec turbo run build` for `@bb/app`, `@bb/server`,
`@bb/host-daemon`, `@bb/cli`, and all `plugins/*` — passes
- `pnpm exec turbo run test` — all packages pass except
`internal-skill-trees.test.ts`, which fails identically on `main` on
this machine (local umask 0002; passes in CI)
- Rebased onto `main` after #2125, #2132, #2128, #2126, #2112 landed;
re-ran typecheck, lint, and tests for the touched packages

Fixes #

> AGENT GENERATED: by Claude Opus 5

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant