Skip to content

drop the two apps API wrappers the socket-driven update flow orphaned - #5850

Merged
atomantic merged 1 commit into
mainfrom
fix/dead-apps-update-api-wrappers
Sep 2, 2026
Merged

drop the two apps API wrappers the socket-driven update flow orphaned#5850
atomantic merged 1 commit into
mainfrom
fix/dead-apps-update-api-wrappers

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • client/src/services/api.deadExports.test.js fails on any full-mode client run with caller-less wrappers: apiApps.js:getPreferredSelfRestartOrigin, apiApps.js:pullAndUpdateApp. main's CI is green only because the run planner scopes tests to changed files, so this blocks unrelated PRs (e.g. fix: publish the endpoint guard through aiToolkit's public barrel #5625, a server-only change).
  • Root cause: 2e996e4d2 moved RepositorySourcePanel.jsx onto the socket-driven useAppOperation hook. Its only remaining api.* calls are getAppRepositorySources and syncAppRepositoryFork.
  • Deleted (not un-exported) both symbols: neither is referenced inside apiApps.jshandleSelfRestart does not call getPreferredSelfRestartOrigin, so there is no intra-module use to preserve.
  • Removed the now-unused import { getNetworkExposure } from './apiSystem.js' and its vi.mock/vi.hoisted scaffolding in apiApps.test.js. No cascade: getNetworkExposure still has live callers in NetworkExposureWidget.jsx and Instances.jsx.
  • Test cleanup: dropped the dead getPreferredSelfRestartOrigin describe block, the two dead vi.fn() mocks in RepositorySourcePanel.test.jsx, and retargeted the vacuous expect(api.pullAndUpdateApp).not.toHaveBeenCalled() at the live surface (useAppOperation(...).startUpdate) so the "Sync fork must not kick off an update" regression is still covered.
  • No barrel or README change needed — api.js re-exports apiApps.js with export *, and the services README catalogs modules, not individual exports.

POST /api/apps/:id/update consumer finding

  • The server route (server/routes/apps/lifecycle.js:240) is left untouched — removing it is out of scope.
  • It now has no client caller. The live update path is the Socket.IO app:update event (server/sockets/apps.js:91), which useAppOperation.js:162 emits; both handlers call the same appUpdater.updateApp.
  • Remaining references are its own route test (server/routes/apps/lifecycle.test.js:401), the generated route catalog, and a historical changelog entry. No sockets, palette/voice manifest entries, or scripts reach it.

Test plan

  • client && npx vitest run src/services/api.deadExports.test.js src/services/apiApps.test.js src/components/apps/tabs/RepositorySourcePanel.test.jsx — 3 files, 13 tests passed.
  • Full client suite client && npm run test:ci861 passed | 1 skipped (862 files), 10756 passed | 2 skipped (10758 tests), 142s. Zero failures; the dead-export guard is green in full mode, which is the point of the fix.
  • client && npm run build — clean.

Fixes #5848

Moving RepositorySourcePanel onto the socket-backed useAppOperation hook
(2e996e4) left `pullAndUpdateApp` and `getPreferredSelfRestartOrigin`
with no production caller, so client/src/services/api.deadExports.test.js
fails on any full-mode run — main's CI stays green only because the run
planner scopes tests to changed files. Neither symbol is referenced
inside apiApps.js (handleSelfRestart does not call either), so both are
deleted rather than un-exported, along with the now-unused apiSystem.js
import and its test mock. The server's POST /api/apps/:id/update route is
untouched; the live update path is the app:update socket event.

Fixes #5848
@atomantic
atomantic merged commit 8b4eedd into main Sep 2, 2026
7 checks passed
@atomantic
atomantic deleted the fix/dead-apps-update-api-wrappers branch September 2, 2026 15:01
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.

Orphaned apiApps wrappers fail the client dead-export guard on main (blocks any full-CI PR)

1 participant