fix(wallet): wire websocket config through module install #163
No reviewers
Labels
No labels
app:activities
app:chat
app:chatelet
app:events
app:forum
app:libra
app:market
app:restaurant
app:tasks
app:wallet
app:webapp
bug
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiolabs/webapp!163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/wallet-websocket-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every websocket setting in
app.config.tswas 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.tsregisters the module withappConfig.modules.wallet, and the plugin manager forwards it asinstall(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'sinstall()forwardsoptions.config.websocket.Using install options rather than importing
@/app.configdirectly 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 fromsrc/wallet-app/app.config.ts, now appears alongside the service default of 5, and nowindow.appConfigread remains:vue-tsc --noEmitis clean andnpm run build:walletsucceeds.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.