fix(wallet): wire websocket config through module install #163

Merged
padreug merged 1 commit from fix/wallet-websocket-config into dev 2026-09-22 21:06:10 +00:00
Owner

Every websocket setting in app.config.ts was ignored. The service read (window as any).appConfig, which nothing in the codebase ever assigns, so the lookup was always undefined and the service silently ran on its own hardcoded defaults.

That includes VITE_WEBSOCKET_ENABLED, which therefore could not actually disable the websocket. The block documented in CLAUDE.md had no effect on anything.

Fix

The config was already being passed correctly. src/wallet-app/app.ts registers the module with appConfig.modules.wallet, and the plugin manager forwards it as install(app, { config }). The service simply was not reading from there.

It now takes the config through its constructor, merged over an exported DEFAULT_WEBSOCKET_CONFIG, and the module's install() forwards options.config.websocket.

Using install options rather than importing @/app.config directly matters here: the hub config no longer declares a wallet module at all, since the wallet ships only as a standalone PWA. A direct import would resolve to a config with no wallet section and reintroduce the same silent-default behaviour.

Verification

Built the standalone wallet app and inspected the bundle. maxReconnectAttempts:3, the value from src/wallet-app/app.config.ts, now appears alongside the service default of 5, and no window.appConfig read remains:

1 maxReconnectAttempts:3     <- from app.config.ts
1 maxReconnectAttempts:5     <- DEFAULT_WEBSOCKET_CONFIG
window.appConfig: not present in bundle

vue-tsc --noEmit is clean and npm run build:wallet succeeds.

Every websocket setting in `app.config.ts` was ignored. The service read `(window as any).appConfig`, which nothing in the codebase ever assigns, so the lookup was always undefined and the service silently ran on its own hardcoded defaults. That includes `VITE_WEBSOCKET_ENABLED`, which therefore could not actually disable the websocket. The block documented in CLAUDE.md had no effect on anything. ## Fix The config was already being passed correctly. `src/wallet-app/app.ts` registers the module with `appConfig.modules.wallet`, and the plugin manager forwards it as `install(app, { config })`. The service simply was not reading from there. It now takes the config through its constructor, merged over an exported `DEFAULT_WEBSOCKET_CONFIG`, and the module's `install()` forwards `options.config.websocket`. Using install options rather than importing `@/app.config` directly matters here: the hub config no longer declares a wallet module at all, since the wallet ships only as a standalone PWA. A direct import would resolve to a config with no wallet section and reintroduce the same silent-default behaviour. ## Verification Built the standalone wallet app and inspected the bundle. `maxReconnectAttempts:3`, the value from `src/wallet-app/app.config.ts`, now appears alongside the service default of 5, and no `window.appConfig` read remains: ``` 1 maxReconnectAttempts:3 <- from app.config.ts 1 maxReconnectAttempts:5 <- DEFAULT_WEBSOCKET_CONFIG window.appConfig: not present in bundle ``` `vue-tsc --noEmit` is clean and `npm run build:wallet` succeeds.
Every websocket setting in `app.config.ts` was ignored. The service read
`(window as any).appConfig`, which nothing in the codebase ever assigns,
so the lookup was always undefined and the service silently ran on its
own hardcoded defaults — including `VITE_WEBSOCKET_ENABLED`, which could
not actually disable the websocket.

The config was already being passed correctly: `src/wallet-app/app.ts`
registers the module with `appConfig.modules.wallet`, and the plugin
manager forwards it as `install(app, { config })`. The service just
wasn't reading from there. It now takes the config through its
constructor, merged over an exported `DEFAULT_WEBSOCKET_CONFIG`.

Using install options rather than importing `@/app.config` directly
matters here: the hub config no longer declares a wallet module at all
(the wallet ships only as a standalone PWA), so a direct import would
resolve to a config with no wallet section.

Verified in the built bundle: `maxReconnectAttempts:3` from
`src/wallet-app/app.config.ts` is present alongside the default of 5,
and no `window.appConfig` read remains.
padreug deleted branch fix/wallet-websocket-config 2026-09-22 21:06:11 +00:00
Sign in to join this conversation.
No description provided.