client/src/services/api.deadExports.test.js fails on current main:
AssertionError: caller-less wrappers:
services/apiApps.js:getPreferredSelfRestartOrigin
services/apiApps.js:pullAndUpdateApp: expected [ …(2) ] to deeply equal []
What happened
The apps repository-source work (merged at 2e996e4d2) moved RepositorySourcePanel.jsx onto the socket-driven useAppOperation hook. The panel no longer calls api.pullAndUpdateApp or api.getPreferredSelfRestartOrigin, but both wrappers — and the tests that mock them — were left in place. Grep confirms the only remaining references are test files:
client/src/services/apiApps.js:170 getPreferredSelfRestartOrigin
client/src/services/apiApps.js:177 pullAndUpdateApp
- referenced only from
client/src/services/apiApps.test.js and client/src/components/apps/tabs/RepositorySourcePanel.test.jsx (as vi.fn() mocks)
Why it matters
main's own CI has been green because the run planner picks affected tests; the failure only surfaces on a full client run. That means any PR that trips full mode is red through no fault of its own — it is currently blocking #5625, a server-only change that touches zero client files.
The RepositorySourcePanel.test.jsx mocks are also now vacuous: they stub two functions the component never calls, and expect(api.pullAndUpdateApp).not.toHaveBeenCalled() passes trivially.
Fix
Decide which of the two the panel was meant to keep:
- If the update flow genuinely moved to sockets (most likely): delete both exports from
apiApps.js, drop the getPreferredSelfRestartOrigin describe block in apiApps.test.js, and remove the two dead mocks plus the vacuous assertion from RepositorySourcePanel.test.jsx. Check whether the server's POST /apps/:id/update route still has any client caller before leaving it in place.
- If the panel should still call them, wire the calls back and the dead-export guard goes green on its own.
Either way the guard test should be green on main before the next full-CI PR lands.
Acceptance criteria
client/src/services/api.deadExports.test.jsfails on currentmain:What happened
The apps repository-source work (merged at
2e996e4d2) movedRepositorySourcePanel.jsxonto the socket-drivenuseAppOperationhook. The panel no longer callsapi.pullAndUpdateApporapi.getPreferredSelfRestartOrigin, but both wrappers — and the tests that mock them — were left in place. Grep confirms the only remaining references are test files:client/src/services/apiApps.js:170getPreferredSelfRestartOriginclient/src/services/apiApps.js:177pullAndUpdateAppclient/src/services/apiApps.test.jsandclient/src/components/apps/tabs/RepositorySourcePanel.test.jsx(asvi.fn()mocks)Why it matters
main's own CI has been green because the run planner picks affected tests; the failure only surfaces on a full client run. That means any PR that trips full mode is red through no fault of its own — it is currently blocking #5625, a server-only change that touches zero client files.The
RepositorySourcePanel.test.jsxmocks are also now vacuous: they stub two functions the component never calls, andexpect(api.pullAndUpdateApp).not.toHaveBeenCalled()passes trivially.Fix
Decide which of the two the panel was meant to keep:
apiApps.js, drop thegetPreferredSelfRestartOrigindescribe block inapiApps.test.js, and remove the two dead mocks plus the vacuous assertion fromRepositorySourcePanel.test.jsx. Check whether the server'sPOST /apps/:id/updateroute still has any client caller before leaving it in place.Either way the guard test should be green on
mainbefore the next full-CI PR lands.Acceptance criteria
cd client && npm run test:cipasses onmain(full mode)apiAppsexport the production tree no longer callsPOST /apps/:id/updateeither has a live client caller or is documented as server/API-only