openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Move redux-logger and debug to devDependencies

Open oxoxDev opened this issue 6 months ago • 1 comments

Summary

app/package.json lists redux-logger and debug in dependencies. Move them to devDependencies and guard usage so production Tauri builds cannot log JWTs / API responses / chat messages.

Problem / Context

Confirmed in app/package.json:

  • "debug": "^4.4.3" under dependencies
  • "redux-logger": "^3.0.6" under dependencies

redux-logger logs every Redux action + state change; debug exposes namespaced console output. Even with Vite tree-shaking, runtime-deps placement is a correctness/audit smell. CWE-532.

Identified by audit #2575 (M-2).

Scope

  • Move both to devDependencies.

  • Wrap any redux-logger middleware import behind import.meta.env.DEV:

    const middleware = [
      ...(import.meta.env.DEV ? [require('redux-logger').default] : []),
    ];
    
  • Verify the production bundle (pnpm build, then grep app/dist) no longer references either package.

Acceptance criteria

  • [ ] redux-logger + debug in devDependencies only
  • [ ] Production bundle does not reference either package (grep smoke)
  • [ ] Dev still gets verbose redux logging
  • [ ] Diff coverage ≥ 80%

Related

  • Parent: #2575
  • CWE-532 — Insertion of Sensitive Information into Log File

oxoxDev avatar May 25 '26 10:05 oxoxDev

Closing — superseded by #2625.

Audit M-2 partially overstated the finding:

  • redux-logger is already gated by IS_DEV in app/src/store/index.ts:175-178. Moving it to devDependencies is still correctness/audit-smell cleanup, so the scoped change tracked in #2625.
  • debug is load-bearing in production code (CoreStateProvider, ChatRuntimeProvider, voice/mascot features, tauriCommands/common.ts, ~10+ call sites). Moving it to devDependencies would break production builds. Leaving it in dependencies.

oxoxDev avatar May 25 '26 10:05 oxoxDev