Skip to content

Commit 92c39b1

Browse files
authored
Fix realtime bugs related to Automation (baserow#4296)
* Check if automation exists before trying to forceCreate a workflow * After deleting an automation app, only redirect to dashboard if the user is viewing a related workflow. * Add changelog
1 parent b36a571 commit 92c39b1

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "bug",
3+
"message": "Fixed a bug where creating a workflow would cause a crash for another user viewing a different app.",
4+
"issue_origin": "github",
5+
"issue_number": 4293,
6+
"domain": "automation",
7+
"bullet_points": [],
8+
"created_at": "2025-11-19"
9+
}

web-frontend/modules/automation/applicationTypes.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,15 @@ export class AutomationApplicationType extends ApplicationType {
5050
return SidebarComponentAutomation
5151
}
5252

53-
delete(application, { $router }) {
54-
$router.push({ name: 'dashboard' })
53+
delete(application) {
54+
const { store, router } = this.app
55+
const workflowSelected = store.getters['automationWorkflow/getWorkflows'](
56+
application
57+
).some((workflow) => workflow._.selected)
58+
59+
if (workflowSelected) {
60+
router.push({ name: 'dashboard' })
61+
}
5562
}
5663

5764
async loadExtraData(automation) {

web-frontend/modules/automation/realtime.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ export const registerRealtimeEvents = (realtime) => {
44
const automation = store.getters['application/get'](
55
data.workflow.automation_id
66
)
7-
store.dispatch('automationWorkflow/forceCreate', {
8-
automation,
9-
workflow: data.workflow,
10-
})
7+
if (automation !== undefined) {
8+
store.dispatch('automationWorkflow/forceCreate', {
9+
automation,
10+
workflow: data.workflow,
11+
})
12+
}
1113
})
1214

1315
realtime.registerEvent('automation_workflow_deleted', ({ store }, data) => {

0 commit comments

Comments
 (0)