mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
* fix(socket): sync deploy button state across collaborators Broadcast workflow-deployed events via socket so all connected users invalidate their deployment query cache when any user deploys, undeploys, activates a version, or triggers a deploy through chat/form endpoints. * fix(socket): check response status on deployment notification Log a warning when the socket server returns a non-2xx status for deployment notifications, matching the pattern in lifecycle.ts. * improvement(config): consolidate socket server URL into getSocketServerUrl/getSocketUrl Replace all inline `env.SOCKET_SERVER_URL || 'http://localhost:3002'` and `getEnv('NEXT_PUBLIC_SOCKET_URL') || 'http://localhost:3002'` with centralized utility functions in urls.ts, matching the getBaseUrl() pattern. * improvement(config): consolidate Ollama URL and CSP socket/Ollama hardcodes Add getOllamaUrl() to urls.ts and replace inline env.OLLAMA_URL fallbacks in the provider and API route. Update CSP to use getSocketUrl(), getOllamaUrl(), and a local toWebSocketUrl() helper instead of hardcoded localhost strings. * lint * fix(tests): add missing mocks for new URL utility exports Update lifecycle, async execute, and chat manage test mocks to include getSocketServerUrl, getOllamaUrl, and notifySocketDeploymentChanged. * fix(csp): remove urls.ts import to fix next.config.ts build CSP is loaded by next.config.ts which transpiles outside the @/ alias context. Use local constants instead of importing from urls.ts. * fix(queries): invalidate chat and form status on deployment change Add chatStatus and formStatus to invalidateDeploymentQueries so all deployment-related queries refresh when any user deploys or undeploys.