Skip to content

refactor(server): drop dead Fence.wait + redundant casts#28710

Merged
kitlangton merged 1 commit into
devfrom
worktree-fence-cleanup
May 21, 2026
Merged

refactor(server): drop dead Fence.wait + redundant casts#28710
kitlangton merged 1 commit into
devfrom
worktree-fence-cleanup

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • `Fence.wait` (the Promise wrapper around `Fence.waitEffect`) has zero callers — `grep -r Fence.wait` across `src/` and `test/` returns nothing. Removing it also drops the last `AppRuntime` import from this module.
  • The `as State` casts in `parse`, `load`, and `diff` were rescuing TS from an `any`-typed filter or just plain redundant. Typing the filter predicate in `parse` removes the need.

Test plan

  • `bun run typecheck` clean
  • `bun run test test/server/httpapi-workspace-routing.test.ts test/server/httpapi-instance.test.ts` — 14/14 pass
  • CI green

Fence.wait (the Promise wrapper) had no callers — only Fence.waitEffect,
parse, diff, load, and HEADER are imported. Removing it also drops the
last AppRuntime use from this module.

Type the filter predicate in parse() so the result is State without a
cast, and let TS infer the return types of load() and diff() (both are
already number-valued).
@kitlangton kitlangton merged commit 86907e2 into dev May 21, 2026
12 checks passed
@kitlangton kitlangton deleted the worktree-fence-cleanup branch May 21, 2026 20:35
MyNameIsGMLi pushed a commit to MyNameIsGMLi/opencode that referenced this pull request May 22, 2026
rustybret pushed a commit to rustybret/opencode that referenced this pull request May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant