v0.3.50: debounce moved server side, hasWorkflowChanged fixes, advanced mode/serializer fix, jira fix, billing notifs#1282
Conversation
* fix(sockets): move debounce to server side * remove comments / unused onBlur
…ic mode params using canonicalParamId (#1274) * fix(serializer): block's params mapper not running first * fix * fix * revert * add canonicalParamId * fix * fix tests * fix discord * fix condition checking * edit condition check * fix * fix subblock config check * fix * add logging * add more logs * fix * fix * attempt * fix discord * remove unused discord code * mark as required correctly
fixed the read and write tools in jira
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Greptile Summary
This PR implements three major fixes to improve the reliability and consistency of the Sim workflow platform:
Server-Side Debouncing Migration: Moves debouncing logic from client-side to server-side to address critical issues where rapid user input was causing character drops and queue congestion. The server now coalesces updates within a 25ms window using Socket.IO, while the client immediately sends operations without complex local state management. This architectural change affects subblock and variable updates across the entire application.
Parameter Mapping Consolidation: Introduces a new canonicalParamId field to the SubBlockConfig interface to resolve conflicts between basic mode (UI selectors) and advanced mode (manual inputs) parameters. This system allows multiple subBlocks that represent the same logical parameter to be consolidated under a single canonical identifier, eliminating the need for custom mapper logic in individual blocks. The change affects 20+ block configurations including Microsoft Excel, Google Sheets, Jira, Slack, Discord, and others.
Jira Integration Fixes: Completely refactors Jira read/write tools to address functionality issues. The bulk read tool switches from issue picker API to search API with JQL queries and implements proper pagination with safety limits. The write tool removes strict validation for issue types and defaults to 'Task'. Parameter resolution is improved with better cloud ID handling and error messages.
Additional improvements include enhanced workflow change detection in the control bar, consolidation of workflow loading logic using helper functions, removal of Discord channel selector components as part of architectural cleanup, and improved error handling across various API endpoints. The changes maintain backward compatibility while significantly improving reliability and user experience.
Confidence score: 3/5
- This PR contains complex architectural changes that could introduce subtle bugs, particularly around the server-side debouncing implementation and parameter mapping system
- Score reflects the high complexity of changes across critical systems (socket handling, parameter resolution, database operations) that require careful testing in production scenarios
- Pay close attention to the Notion and Airtable blocks which have credential parameter mismatches that could break OAuth integrations
44 files reviewed, 16 comments
| layout: 'full', | ||
| placeholder: 'Enter Discord server ID', | ||
| mode: 'advanced', | ||
| required: true, |
There was a problem hiding this comment.
logic: Setting required: true on serverId but it's conditional - this could cause validation issues when operation doesn't require serverId
| useOperationQueueStore.getState().isProcessing, | ||
| useOperationQueueStore.getState().operations.length, |
There was a problem hiding this comment.
style: Direct store state access in dependency array may cause unnecessary re-renders. Consider extracting these values as separate state variables outside the effect.
| layout: 'full', | ||
| placeholder: 'Enter Discord channel ID', | ||
| mode: 'advanced', | ||
| required: true, |
There was a problem hiding this comment.
logic: Setting required: true on channelId but it's conditional - this could cause validation issues when operation doesn't require channelId
| ], | ||
| })) |
There was a problem hiding this comment.
logic: Missing new operation in the filtered operations array - this will drop the current operation
| ], | |
| })) | |
| ], | |
| })) | |
| } | |
| // Add the new operation after filtering | |
| const queuedOp: QueuedOperation = { | |
| ...operation, | |
| timestamp: Date.now(), | |
| retryCount: 0, | |
| status: 'pending', | |
| } | |
| set((state) => ({ | |
| operations: [...state.operations, queuedOp], |
| ], | ||
| })) |
There was a problem hiding this comment.
logic: Same issue here - the current operation is not added back to the filtered array
| ], | |
| })) | |
| ], | |
| })) | |
| } | |
| // Add the new operation after filtering | |
| const queuedOp: QueuedOperation = { | |
| ...operation, | |
| timestamp: Date.now(), | |
| retryCount: 0, | |
| status: 'pending', | |
| } | |
| set((state) => ({ | |
| operations: [...state.operations, queuedOp], |
| const matchedResource = accessibleResources.find( | ||
| (r: any) => r.url.toLowerCase() === normalizedInput | ||
| ) |
There was a problem hiding this comment.
logic: No null check for matchedResource - could throw if domain doesn't match any accessible resources
| const matchedResource = accessibleResources.find( | |
| (r: any) => r.url.toLowerCase() === normalizedInput | |
| ) | |
| const matchedResource = accessibleResources.find( | |
| (r: any) => r.url.toLowerCase() === normalizedInput | |
| ) | |
| if (!matchedResource) { | |
| return { | |
| success: false, | |
| output: [], | |
| } | |
| } |
| properties: [], | ||
| }), | ||
| }) | ||
| const pageData = await pageResponse.json() |
There was a problem hiding this comment.
logic: Missing error handling for failed API requests - should check pageResponse.ok before parsing JSON
| Accept: 'application/json', | ||
| }, | ||
| }) | ||
| const pageData = await pageResponse.json() |
There was a problem hiding this comment.
logic: Missing error handling for failed API requests - should check pageResponse.ok before parsing JSON
| if (!issueForRead) { | ||
| throw new Error( | ||
| 'Issue Key is required. Please select an issue or enter an issue key manually.' | ||
| 'Select a project to read issues, or provide an issue key to read a single issue.' | ||
| ) | ||
| } |
There was a problem hiding this comment.
logic: Error message is misleading - says 'Select a project to read issues' but validation checks for issueKey, not project. Should validate project selection for bulk read or issue key for single issue read.
| if (!issueForRead) { | |
| throw new Error( | |
| 'Issue Key is required. Please select an issue or enter an issue key manually.' | |
| 'Select a project to read issues, or provide an issue key to read a single issue.' | |
| ) | |
| } | |
| if (!issueForRead) { | |
| throw new Error( | |
| 'Issue Key is required. Please select an issue or enter an issue key manually.' | |
| ) | |
| } |
|
|
||
| if (workflowExists.length === 0) { | ||
| pending.opToSocket.forEach((socketId, opId) => { | ||
| const sock = (roomManager as any).io?.sockets?.sockets?.get(socketId) |
There was a problem hiding this comment.
style: Type assertion to any bypasses TypeScript safety - consider defining proper types for the RoomManager io property
Context Used: Context - Avoid using type assertions to 'any' in TypeScript. Instead, ensure proper type definitions are used to maintain type safety. (link)
…es, and welcome emails (#1266) * feat(notifications): added notifications for usage thresholds, overages, and welcome emails * cleanup * updated logo, ack PR comments * ran migrations
* update infra and remove railway * fix(notifications): increase precision on billing calculations * Revert "update infra and remove railway" This reverts commit d17603e. * cleanup
Summary
Sockets fix: move debounce to server side; cleanup unused onBlur (#1265)
Subblock param mapping fix: consolidate resolution of advanced/basic mode params using canonicalParamId; multiple related fixes, tests, and logging (#1274)
Jira fix: reading multiple issues and write — fixed read/write tools
Notifications: added notifications for usage thresholds, overages, welcome emails, etc (#1266)