mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
fix(config): log RPC URL and core mode as strings, not object wrappers (#2459)
Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
This commit is contained in:
co-authored by
Steven Enamakel
parent
27bea247cf
commit
333bd52842
@@ -457,6 +457,21 @@ describe('configPersistence', () => {
|
||||
expect(getStoredCoreMode()).toBeNull();
|
||||
});
|
||||
|
||||
it('logs the mode string directly, not an object wrapper', () => {
|
||||
const spy = vi.spyOn(console, 'debug').mockImplementation(() => {});
|
||||
try {
|
||||
storeCoreMode('cloud');
|
||||
const calls = spy.mock.calls.flat();
|
||||
// Must NOT log an object like { mode } — that renders as [object Object]
|
||||
const hasObjectArg = calls.some(arg => typeof arg === 'object' && arg !== null);
|
||||
expect(hasObjectArg).toBe(false);
|
||||
const modeArg = calls.find(arg => typeof arg === 'string' && arg === 'cloud');
|
||||
expect(modeArg).toBe('cloud');
|
||||
} finally {
|
||||
spy.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
it('falls back to the E2E default local mode when no marker has been written', async () => {
|
||||
vi.resetModules();
|
||||
vi.doMock('../config', () => ({
|
||||
|
||||
@@ -292,7 +292,7 @@ export function getStoredCoreMode(): 'local' | 'cloud' | null {
|
||||
export function storeCoreMode(mode: 'local' | 'cloud'): void {
|
||||
try {
|
||||
localStorage.setItem(CORE_MODE_STORAGE_KEY, mode);
|
||||
console.debug('[configPersistence] Stored core mode:', { mode });
|
||||
console.debug('[configPersistence] Stored core mode:', mode);
|
||||
} catch {
|
||||
console.warn('[configPersistence] Unable to store core mode in localStorage');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user