learning_ai_invt_trdg/backend/verify_dynamic_config.ts
Saravana Achu Mac 6fac10de9d refactor(backend): root scripts use legacySupabase client where possible
- Call loadDynamicConfig() without dead supabaseService argument (Cosmos-backed).
- Use getLegacySupabaseClient() for raw .from() queries in maintenance scripts.
- manualOverrideCloseTrades: typed imports + legacy client for lifecycle SELECT.
- verify_realtime: ESM .js imports and comment for subscribeToProfiles.
- verifyTenantIsolation: comment for singleton monkey-patch.

Made-with: Cursor
2026-04-04 20:44:24 -07:00

29 lines
1.1 KiB
TypeScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { loadDynamicConfig, config } from '../src/config/index.js';
import logger from '../src/utils/logger.js';
async function testDynamicConfigLoading() {
logger.info('--- Testing Dynamic Config Loading (control-plane storage) ---');
// 1. Initial State (from .env)
const initialSymbols = [...config.SYMBOLS];
logger.info(`Initial Symbols (.env): ${initialSymbols.join(', ')}`);
// 2. Load from DB
await loadDynamicConfig();
// 3. Final State
logger.info(`Final Symbols (After DB Load): ${config.SYMBOLS.join(', ')}`);
if (JSON.stringify(initialSymbols) !== JSON.stringify(config.SYMBOLS)) {
logger.info('✅ SUCCESS: Dynamic config successfully overwrote .env defaults!');
} else {
logger.info(' INFO: config.SYMBOLS remained the same. This is normal if DB matches .env or if DB was empty.');
}
// Check other keys if present
logger.info(`Execution Provider: ${config.EXECUTION_PROVIDER}`);
logger.info(`Total Capital: ${config.TOTAL_CAPITAL}`);
}
testDynamicConfigLoading().catch(console.error);