Skip to content

Commit d8839d3

Browse files
committed
remove dead code
1 parent 5dc8a69 commit d8839d3

File tree

5 files changed

+0
-88
lines changed

5 files changed

+0
-88
lines changed

apps/sim/app/workspace/providers/socket-provider.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -430,28 +430,6 @@ export function SocketProvider({ children, user }: SocketProviderProps) {
430430
return true
431431
}
432432

433-
socketInstance.on('copilot-workflow-edit', async (data) => {
434-
logger.info(
435-
`Copilot edited workflow ${data.workflowId} - rehydrating stores from database`
436-
)
437-
438-
try {
439-
const response = await fetch(`/api/workflows/${data.workflowId}`)
440-
if (response.ok) {
441-
const responseData = await response.json()
442-
const workflowData = responseData.data
443-
444-
if (workflowData?.state) {
445-
await rehydrateWorkflowStores(data.workflowId, workflowData.state, 'copilot')
446-
}
447-
} else {
448-
logger.error('Failed to fetch fresh workflow state:', response.statusText)
449-
}
450-
} catch (error) {
451-
logger.error('Failed to rehydrate stores after copilot edit:', error)
452-
}
453-
})
454-
455433
socketInstance.on('operation-confirmed', (data) => {
456434
logger.debug('Operation confirmed', { operationId: data.operationId })
457435
eventHandlers.current.operationConfirmed?.(data)

apps/sim/socket/rooms/memory-manager.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -234,27 +234,4 @@ export class MemoryRoomManager implements IRoomManager {
234234

235235
logger.info(`Notified ${room.users.size} users about workflow update: ${workflowId}`)
236236
}
237-
238-
async handleCopilotWorkflowEdit(workflowId: string, description?: string): Promise<void> {
239-
logger.info(`Handling copilot workflow edit notification for ${workflowId}`)
240-
241-
const room = this.workflowRooms.get(workflowId)
242-
if (!room) {
243-
logger.debug(`No active room found for copilot workflow edit ${workflowId}`)
244-
return
245-
}
246-
247-
const timestamp = Date.now()
248-
249-
this._io.to(workflowId).emit('copilot-workflow-edit', {
250-
workflowId,
251-
description,
252-
message: 'Copilot has edited the workflow - rehydrating from database',
253-
timestamp,
254-
})
255-
256-
room.lastModified = timestamp
257-
258-
logger.info(`Notified ${room.users.size} users about copilot workflow edit: ${workflowId}`)
259-
}
260237
}

apps/sim/socket/rooms/redis-manager.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -407,28 +407,4 @@ export class RedisRoomManager implements IRoomManager {
407407
const userCount = await this.getUniqueUserCount(workflowId)
408408
logger.info(`Notified ${userCount} users about workflow update: ${workflowId}`)
409409
}
410-
411-
async handleCopilotWorkflowEdit(workflowId: string, description?: string): Promise<void> {
412-
logger.info(`Handling copilot workflow edit notification for ${workflowId}`)
413-
414-
const hasRoom = await this.hasWorkflowRoom(workflowId)
415-
if (!hasRoom) {
416-
logger.debug(`No active room found for copilot workflow edit ${workflowId}`)
417-
return
418-
}
419-
420-
const timestamp = Date.now()
421-
422-
this._io.to(workflowId).emit('copilot-workflow-edit', {
423-
workflowId,
424-
description,
425-
message: 'Copilot has edited the workflow - rehydrating from database',
426-
timestamp,
427-
})
428-
429-
await this.updateRoomLastModified(workflowId)
430-
431-
const userCount = await this.getUniqueUserCount(workflowId)
432-
logger.info(`Notified ${userCount} users about copilot workflow edit: ${workflowId}`)
433-
}
434410
}

apps/sim/socket/rooms/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,4 @@ export interface IRoomManager {
132132
* Handle workflow update - notify users
133133
*/
134134
handleWorkflowUpdate(workflowId: string): Promise<void>
135-
136-
/**
137-
* Handle copilot workflow edit - notify users to rehydrate
138-
*/
139-
handleCopilotWorkflowEdit(workflowId: string, description?: string): Promise<void>
140135
}

apps/sim/socket/routes/http.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,6 @@ export function createHttpHandler(roomManager: IRoomManager, logger: Logger) {
115115
return
116116
}
117117

118-
// Handle copilot workflow edit notifications from the main API
119-
if (req.method === 'POST' && req.url === '/api/copilot-workflow-edit') {
120-
try {
121-
const body = await readRequestBody(req)
122-
const { workflowId, description } = JSON.parse(body)
123-
await roomManager.handleCopilotWorkflowEdit(workflowId, description)
124-
sendSuccess(res)
125-
} catch (error) {
126-
logger.error('Error handling copilot workflow edit notification:', error)
127-
sendError(res, 'Failed to process copilot edit notification')
128-
}
129-
return
130-
}
131-
132118
// Handle workflow revert notifications from the main API
133119
if (req.method === 'POST' && req.url === '/api/workflow-reverted') {
134120
try {

0 commit comments

Comments
 (0)