Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

@icecrasher321 icecrasher321 commented Jan 31, 2026

Summary

Sockets -- Reconnecting... notif since workflow join in self healing now.

New Rate Limits
RATE_LIMIT_FREE_SYNC=50
RATE_LIMIT_FREE_ASYNC=200
RATE_LIMIT_PRO_SYNC=150
RATE_LIMIT_PRO_ASYNC=1000
RATE_LIMIT_TEAM_SYNC=300
RATE_LIMIT_TEAM_ASYNC=2500
RATE_LIMIT_ENTERPRISE_SYNC=600
RATE_LIMIT_ENTERPRISE_ASYNC=5000

Type of Change

  • Other: Rate Limits

Testing

N/A

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 31, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 1, 2026 0:42am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 31, 2026

Greptile Overview

Greptile Summary

This PR increases rate limits across all subscription tiers and adds reconnection notifications for improved user experience during socket disruptions.

Rate Limit Changes:

  • Free: 10→50 sync, 50→200 async (5x increase)
  • Pro: 25→150 sync, 200→1,000 async (6-5x increase)
  • Team: 75→300 sync, 500→2,500 async (4-5x increase)
  • Enterprise: 150→600 sync, 1,000→5,000 async (4-5x increase)

All user-facing documentation, UI components, email templates, and deployment configs have been consistently updated.

Socket Reconnection Improvements:

  • Added isReconnecting state to track reconnection attempts
  • Shows "Reconnecting..." notification during reconnection (hidden during offline mode)
  • Improved reconnection event handling by using socketInstance.io manager events instead of socket-level events
  • Added workflowId parameter to subblock/variable update operations to prevent cross-workflow updates

Cross-Workflow Protection:
Server handlers now validate that the workflowId in the payload matches the socket's session workflow, preventing accidental cross-workflow updates in multi-workflow scenarios. Client-side broadcast handlers also filter by workflowId.

Minor Issues:

  • Indentation error in api.mdx JSON example (line 110)
  • Inconsistent variable usage in use-collaborative-workflow.ts (line 1182)

Confidence Score: 4/5

  • Safe to merge with minor documentation fix needed
  • Score reflects comprehensive rate limit updates across all layers (backend, frontend, docs, deployment) with proper socket reconnection improvements. Two minor issues found: indentation error in documentation JSON example and inconsistent variable usage that should be aligned for code consistency.
  • Fix indentation in apps/docs/content/docs/en/execution/api.mdx:110 and consider aligning variable usage in apps/sim/hooks/use-collaborative-workflow.ts:1182

Important Files Changed

Filename Overview
apps/sim/app/workspace/providers/socket-provider.tsx Added isReconnecting state and improved reconnection event handling by using socketInstance.io manager events. Type signature updates for emit functions to include workflowId parameter.
apps/sim/hooks/use-collaborative-workflow.ts Removed isInActiveRoom check in favor of simpler activeWorkflowId checks. Added workflowId filtering to prevent cross-workflow updates in broadcast handlers.
apps/sim/socket/handlers/subblocks.ts Added workflowId validation to prevent cross-workflow updates by checking payload workflowId against session workflowId. Broadcasts now include workflowId field.
apps/sim/socket/handlers/variables.ts Added workflowId validation to prevent cross-workflow updates by checking payload workflowId against session workflowId. Broadcasts now include workflowId field.
apps/sim/stores/operation-queue/store.ts Updated emit function signatures to require workflowId parameter. Changed non-retryable operation failures to trigger offline mode instead of silently removing from queue.
apps/sim/lib/core/config/env.ts Updated rate limit defaults: Free (50/200), Pro (150/1000), Team (300/2500), Enterprise (600/5000) for sync/async executions.

Sequence Diagram

sequenceDiagram
    participant Client as Client (Browser)
    participant Socket as Socket Provider
    participant Server as Socket.IO Server
    participant Room as Room Manager
    participant DB as Database
    
    Note over Client,DB: Normal Operation
    Client->>Socket: User makes workflow change
    Socket->>Server: emit('subblock-update', {workflowId, ...})
    Server->>Room: Validate workflowId matches session
    Room-->>Server: Validation OK
    Server->>DB: Update subblock value
    DB-->>Server: Update confirmed
    Server->>Client: broadcast('subblock-update') to room
    
    Note over Client,DB: Socket Disconnection
    Server--xClient: Connection lost
    Socket->>Socket: Set isConnected = false
    Socket->>Socket: Check socket.active = true
    Socket->>Socket: Set isReconnecting = true
    Socket->>Client: Show "Reconnecting..." notification
    
    Note over Client,DB: Reconnection Process
    Socket->>Server: socketInstance.io reconnect attempt
    Server-->>Socket: connect_error (temporary)
    Socket->>Socket: isReconnecting remains true
    Socket->>Server: socketInstance.io reconnect attempt 2
    Server-->>Socket: connect success
    Socket->>Socket: Set isConnected = true
    Socket->>Socket: Set isReconnecting = false
    Socket->>Client: Remove "Reconnecting..." notification
    Socket->>Server: emit('join-workflow', workflowId)
    Server->>Room: Add socket to workflow room
    Room-->>Socket: join-workflow-success + presence
    
    Note over Client,DB: Operation Queue Resumes
    Socket->>Server: Process queued operations
    Server->>Room: Validate workflowId for each operation
    Server->>DB: Apply queued changes
    Server->>Client: Broadcast updates to room
    
    Note over Client,DB: Cross-Workflow Protection
    Client->>Socket: Operation with workflowId A
    Socket->>Server: emit with workflowId A in payload
    Server->>Room: Check sessionWorkflowId = B
    Room-->>Server: Mismatch detected
    Server->>Socket: emit('operation-failed', retryable)
    Socket->>Socket: Queue handles retry
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321 icecrasher321 changed the title improvement(rate-limits): increase across all plans improvement(ratelimits, sockets): increase across all plans, reconnecting notif for sockets Jan 31, 2026
@icecrasher321
Copy link
Collaborator Author

@cursor review

@icecrasher321
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 1, 2026

Additional Comments (1)

apps/sim/hooks/use-collaborative-workflow.ts
inconsistent variable usage - should use activeWorkflowId like other operations instead of re-fetching from store as currentActiveWorkflowId

        workflowId: activeWorkflowId || '',

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/hooks/use-collaborative-workflow.ts
Line: 1182:1182

Comment:
inconsistent variable usage - should use `activeWorkflowId` like other operations instead of re-fetching from store as `currentActiveWorkflowId`

```suggestion
        workflowId: activeWorkflowId || '',
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

@icecrasher321 icecrasher321 merged commit e1ac201 into staging Feb 1, 2026
11 checks passed
@icecrasher321 icecrasher321 deleted the improvement/rate-lims branch February 1, 2026 00:49
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.

2 participants