Skip to content

v0.6.49: deploy sockets event, resolver, logs improvements#4209

Merged
waleedlatif1 merged 8 commits intomainfrom
staging
Apr 17, 2026
Merged

v0.6.49: deploy sockets event, resolver, logs improvements#4209
waleedlatif1 merged 8 commits intomainfrom
staging

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

@icecrasher321 icecrasher321 commented Apr 17, 2026

waleedlatif1 and others added 5 commits April 16, 2026 16:47
… barrel imports (#4205)

* improvement(tables): clean up duplicate types, unnecessary memos, and barrel imports

* fix(tables): revert barrel import in client component to avoid bundling server-only deps
* 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.
…tus filters, and React anti-patterns (#4207)

* improvement(logs): fix trigger badge wrapping, time range picker, status filters, and React anti-patterns

* chore(logs): remove dev mock logs

* fix(logs): prevent DatePicker onOpenChange from reverting time range after Apply
Previously, Non-ASCII characters (like Korean) in workflow names were
replaced by dashes during export because of a restrictive regex.
This update uses a Unicode-aware regex to allow letters and numbers
from any language while still sanitizing unsafe filesystem characters.

fixes #4119

Signed-off-by: JaeHyung Jang <jaehyung.jang@navercorp.com>
…#4208)

* fix(resolver): turn off resolver for opaque schema nodes, unrun paths

* fix subflows to make them consistent

* fix tests
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Apr 17, 2026 3:31am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 17, 2026

PR Summary

Medium Risk
Touches workflow deployment orchestration + socket notifications and changes variable/reference resolution semantics, which can affect collaboration sync and runtime execution behavior if edge cases are missed.

Overview
Adds a new socket-level "deployment changed" signal: server-side deploy/undeploy/activate (and chat/form auto-redeploy) now call notifySocketDeploymentChanged, the socket service exposes POST /api/workflow-deployed and broadcasts workflow-deployed, and clients subscribe to it to invalidate deployment-related React Query caches so deploy button/state stays in sync across collaborators.

Consolidates socket/Ollama URL resolution behind getSocketServerUrl/getSocketUrl/getOllamaUrl (and updates CSP + various fetch callsites/tests accordingly), and makes workflow export filenames Unicode-safe by loosening sanitizePathSegment.

Fixes executor edge cases: block reference resolution no longer validates schema paths for blocks that didn’t execute, and treats json/object/any schema nodes as opaque so nested paths resolve to empty instead of throwing; loop/parallel array input resolution now treats null (skipped-block reference) as an empty iteration set.

Includes several logs/tables UI refinements (filterable statuses, DatePicker open/cancel handling, nowrap trigger badges, small React refactors) and minor type/import cleanups.

Reviewed by Cursor Bugbot for commit 3d909d5. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 17, 2026

Greptile Summary

This PR covers five distinct improvements: (1) a new workflow-deployed socket event that broadcasts deployment-state changes to all collaborators so the deploy button syncs without a manual refresh; (2) centralized getSocketServerUrl / getSocketUrl / getOllamaUrl helpers that replace scattered inline fallbacks; (3) resolver fixes that skip path-schema validation on unrun/branched blocks and treat opaque schema types (json, any, object without properties) as wildcard nodes; (4) a Unicode-safe sanitizePathSegment regex for ZIP export filenames; and (5) logs UI cleanups removing unnecessary useMemo wrappers, filtering non-filterable statuses, and refactoring the DatePicker interaction out of a DropdownMenu.

Confidence Score: 5/5

Safe to merge — all substantive changes (resolver fix, socket deployment event, Unicode export, URL consolidation) are correct and well-tested.

No P0 or P1 issues found. The only finding is a P2 style comment about an eslint-disable pragma that contradicts the project's no-non-TSDoc-comment rule. Every behavioral fix is covered by new or updated tests.

No files require special attention beyond the minor eslint-disable comment in import-csv-dialog.tsx.

Important Files Changed

Filename Overview
apps/sim/lib/workflows/orchestration/deploy.ts Adds notifySocketDeploymentChanged helper and calls it at the end of performFullDeploy, performFullUndeploy, and performActivateVersion; also migrates inline socket URL fallback to getSocketServerUrl().
apps/sim/executor/utils/block-reference.ts Fixes resolver to skip schema path-validation when blockOutput is undefined (unrun/branched block) and adds isOpaqueSchemaNode guard for json/any/object-without-properties fields; schema is now only read after blockOutput is confirmed present.
apps/sim/socket/routes/http.ts Adds POST /api/workflow-deployed handler; correctly falls under the existing shared API-key auth block for all POST requests.
apps/sim/lib/core/utils/urls.ts Introduces getSocketServerUrl, getSocketUrl, and getOllamaUrl helpers that centralise the env-var + localhost fallback pattern previously scattered across multiple files.
apps/sim/lib/workflows/operations/import-export.ts Replaces the ASCII-only sanitizePathSegment regex with a Unicode-property-escape variant that preserves letters and numbers from all scripts; consecutive replacement dashes are collapsed.
apps/sim/app/workspace/providers/socket-provider.tsx Adds onWorkflowDeployed callback and workflow-deployed socket listener; migrates socket URL construction to getSocketUrl().
apps/sim/hooks/use-collaborative-workflow.ts Wires onWorkflowDeployed to invalidateDeploymentQueries so collaborators' deploy-button state refreshes when a deployment event arrives.
apps/sim/app/workspace/[workspaceId]/logs/components/logs-toolbar/logs-toolbar.tsx Removes several useMemo wrappers for derived display labels, adds filterable status filtering, refactors DatePicker out of DropdownMenu using a dateRangeAppliedRef pattern.
apps/sim/executor/utils/subflow-utils.ts Handles null (skipped-block) resolved references in resolveArrayInput by returning an empty array rather than throwing.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx Fixes workflow/table display-name lookups to guard on subBlock.type ('workflow-selector'/'table-selector') instead of subBlock.id, making them robust across blocks with varying IDs.
apps/sim/app/workspace/[workspaceId]/tables/components/import-csv-dialog/import-csv-dialog.tsx Removes importCsv alias and inlines importMutation.mutateAsync per TanStack v5 stability guarantee; removes unnecessary useMemo for capacity-deficit calculations.
apps/sim/lib/table/query-builder/use-query-builder.ts Lifts comparisonOptions, logicalOptions, and sortDirectionOptions to module-level constants (derived from static data), eliminating useMemo with empty deps that added no value.

Sequence Diagram

sequenceDiagram
    participant API as Next.js API Route
    participant Deploy as deploy.ts / chat-route / form-route
    participant Socket as Socket Server (http.ts)
    participant Manager as IRoomManager
    participant Client as Collaborator Browser

    API->>Deploy: performFullDeploy / performFullUndeploy / performActivateVersion
    Deploy->>Socket: POST /api/workflow-deployed {workflowId}
    Note right of Deploy: notifySocketDeploymentChanged()
    Socket->>Manager: handleWorkflowDeployed(workflowId)
    Manager->>Client: socket.emit('workflow-deployed', {workflowId, timestamp})
    Client->>Client: invalidateDeploymentQueries(queryClient, workflowId)
    Note right of Client: useCollaborativeWorkflow → onWorkflowDeployed handler
Loading

Reviews (1): Last reviewed commit: "fix(resolver): turn off resolver for opa..." | Re-trigger Greptile

… update docs for theshold billing (#4212)

* fix(mothership): content block spaces trimmed

* update overage threshold docs
…4211)

* feat(triggers): add Atlassian triggers for Jira, JSM, and Confluence

- Jira: add 9 new triggers (sprint created/started/closed, project created, version released, comment updated/deleted, worklog updated/deleted)
- JSM: add 5 triggers from scratch (request created/updated/commented/resolved, generic webhook)
- Confluence: add 7 new triggers (comment updated, attachment updated, page/blog restored, space removed, page permissions updated, user created)
- Add JSM webhook provider handler with HMAC validation and changelog-based event matching
- Add Atlassian webhook identifier to idempotency service for native dedup
- Add extractIdempotencyId to Confluence handler
- Fix Jira generic webhook to pass through full payload for non-issue events
- Fix output schemas: add description (ADF), updateAuthor, resolution, components, fixVersions, worklog timestamps, note emailAddress as Jira Server only

* fix(triggers): replace any with Record<string, unknown> in confluence extract functions

* lint

* fix(triggers): use comment.id in JSM idempotency, fix confluence type cast

JSM extractIdempotencyId now prioritizes comment.id over issue.id for
comment_created events, matching Jira's documented webhook payload
structure. Also fixes type cast for confluence extract function calls.

* fix(triggers): correct comment.body type to json, fix TriggerOutput description type

- JSM webhook comment.body changed from string to json (ADF format)
- Widened TriggerOutput.description to accept TriggerOutput objects,
  removing unsafe `as unknown as string` casts for Jira description fields
* feat(monday): add full Monday.com integration with tools, block, triggers, and OAuth

Adds a comprehensive Monday.com integration:
- 13 tools: list/get boards, CRUD items, search, subitems, updates, groups, move, archive
- Block with operation dropdown, board/group selectors, OAuth credential, advanced mode
- 9 webhook triggers with auto-subscription lifecycle (create/delete via GraphQL API)
- OAuth config with 7 scopes (boards, updates, webhooks, me:read)
- Provider handler with challenge verification, formatInput, idempotency
- Docs, icon, selectors, and all registry wiring

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(monday): cast userId to string in deleteSubscription fallback

The DeleteSubscriptionContext type has userId as unknown, causing a
TypeScript error when passing it to getOAuthToken which expects string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(monday): escape string params in GraphQL, align deleteSubscription with established patterns

- Use JSON.stringify() for groupId in get_items.ts (matches create_item.ts
  and move_item_to_group.ts)
- Use JSON.stringify() for notificationUrl in webhook provider
- Remove non-standard getOAuthToken fallback in deleteSubscription to match
  Airtable/Webflow pattern (credential resolution only, warn and return on failure)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(monday): sanitize columns JSON in search_items GraphQL query

Parse and re-stringify the columns param to ensure well-formed JSON
before interpolating into the GraphQL query, preventing injection
via malformed input.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(monday): validate all numeric IDs and sanitize columns in GraphQL queries

- Add sanitizeNumericId() helper to tools/monday/utils.ts for consistent
  validation across all tool body builders
- Apply to all 13 instances of boardId, itemId, parentItemId interpolation
  across 11 tool files, preventing GraphQL injection via crafted IDs
- Wrap JSON.parse in search_items.ts with try-catch for user-friendly
  error on malformed column filter JSON

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(monday): deduplicate numeric ID validation, sanitize limit/page params

- Refactor sanitizeNumericId to delegate to validateMondayNumericId
  from input-validation.ts, eliminating duplicated regex logic
- Add sanitizeLimit helper for safe integer coercion with bounds
- Apply sanitizeLimit to limit/page params in list_boards, get_items,
  and search_items for consistent validation across all GraphQL params

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(monday): align list_boards limit description with code (max 500)

The param description said "max 100" but sanitizeLimit caps at 500,
which is what Monday.com's API supports for boards. Updated both the
tool description and docs to say "max 500".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 merged commit dcf3302 into main Apr 17, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants