Skip to content

chore(web): upgrade next to 16.4.2 - #1108

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:chore/next-16-4
Oct 17, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:chore/next-16-4

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Upgrades next from 16.1.6 to 16.4.2 (web/), to fix a Next.js bug that leaves the Prompts table spinning forever after a quick tab or range switch.

The bug

  • Next turns a history.replaceState into a router "restore" action. The Prompts page uses replaceState to keep its route in sync with the tab, view and range (PROMPT-001).
  • In 16.1.6, a restore that lands while a server action is in flight marks that action discarded, but the queue keeps pointing at it.
  • When the discarded action settles, runRemainingActions advances anyway. The actions queued behind it never run.
  • On the page, the table's read never starts, and the spinner stays until a reload.
  • Next 16.3.0 fixed it: runRemainingActions(actionQueue, settledAction, …) only advances while the settled action is still at the queue's head. 16.1.7 and 16.2.x don't have the fix; 16.4.2 is latest.

What changes

  • web/package.json: next 16.1.6 → 16.4.2, pinned as before.
  • web/yarn.lock: next's own dependencies only:
    • @next/env and @next/swc-* 16.4.2;
    • sharp 0.35;
    • postcss 8.5;
    • @swc/helpers.
  • eslint-config-next stays at 16.1.6.
    • 16.4.2 brings eslint-plugin-react-hooks 7.1, whose React Compiler rules (set-state-in-effect, immutability, purity, refs) fail yarn lint in 84 places across the app.
    • Aligning it is a change of its own; the lint rules don't affect the running app.
  • Nothing else needed changing:
    • proxy.ts and next.config.ts work as they are.
    • Docker (node:20-alpine) and CI (Node 20) meet 16.4.2's Node ≥20.9.

Related issue

None. The stall shows on main, and it is the known limit in #1107.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. cd web && yarn install, then yarn dev (or yarn build && yarn start).
  2. Open Prompts. Click Query Fan-out, then Prompts again within about half a second, and repeat a few times. The table loads every time.
    • On 16.1.6, this leaves the table spinning forever.
  3. Walk the other pages: Insights, Citations, Action Center, Content, Site Audit, Reports, Shopping, AI Traffic, Agent, Settings, and a prompt's page. They load as before.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): no errors; the 7 warnings are on main too
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Also run:

  • web: yarn test (851) and yarn build pass, on Next.js 16.4.2 with Turbopack. The routes are the same as before.

  • The stall, before and after, with demo data and a scripted switch from Query Fan-out back to Prompts:

    16.1.6 the table's read never started at a 600 ms switch, and the spinner stayed
    16.4.2 the table loaded in 8 of 8 runs (60–900 ms)
  • With feat(prompts): move Topics into the Prompts area as its Topics tab #1107 on top, switching from its Topics tab to Prompts 0–700 ms after Topics opens loaded the table in 6 of 6 runs. On 16.1.6 this stalled at 25 ms and at 400 ms.

  • Smoke test on a production build: 17 dashboard pages and redirects load without errors. The console's only 404 is /_vercel/insights/script.js, which a local build never has. yarn dev starts and serves the Prompts page.

Merge order: this can merge on its own. Merging it before or with #1107 removes that PR's known limit.

🤖 Generated with Claude Code

Next 16.1.6 loses server actions after a router "restore": when a
history.replaceState (which Next turns into a restore) lands while a
server action is in flight, the action is discarded but the queue keeps
pointing at it, so the actions queued behind it never run. On the Prompts
page that leaves the table spinning forever after a quick tab or range
switch. Next 16.3.0 fixed it (runRemainingActions only advances when the
settled action is still at the queue's head); 16.4.2 is the latest.

eslint-config-next stays at 16.1.6: 16.4.2 brings
eslint-plugin-react-hooks 7.1, whose React Compiler rules fail lint in 84
places, which is a change of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk this is ready for review: a one-package upgrade (next 16.1.6 → 16.4.2) that fixes the Prompts table spinning forever after a quick tab or range switch, which is on main today. It can merge on its own; merging it before or with #1107 also removes that PR's known limit. After it merges, deploys and local checkouts need a yarn install in web/.

@gkhngyk
gkhngyk merged commit 908f09e into ansvisor:main Oct 17, 2026
6 checks passed
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.

2 participants