Skip to content

[backport core/1.41] fix: Prevent corruption of workflow data due to checkState during graph loading (#9531)#9561

Merged
christian-byrne merged 1 commit intocore/1.41from
backport-9531-to-core-1.41
Mar 8, 2026
Merged

[backport core/1.41] fix: Prevent corruption of workflow data due to checkState during graph loading (#9531)#9561
christian-byrne merged 1 commit intocore/1.41from
backport-9531-to-core-1.41

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Mar 8, 2026

Backport of #9531 to core/1.41.

Cherry-pick of merge commit ec129de applied cleanly.

Original PR: #9531
Pipeline ticket: 15e1f241-efaa-4fe5-88ca-4ccc7bfb3345

┆Issue is synchronized with this Notion page by Unito

…ph loading (#9531)

## Summary

During workflow loading, the workflow data & active workflow object can
be out of sync, meaning any checkState calls will overwrite data into
the wrong workflow.

Recreation steps:
* Open 2-3 workflows
* Enter builder mode > select step
* Select some different inputs on each
* Quickly tap the shift key (this triggers checkState) while switching
tabs
* After a while, you'll see the wrong inputs on the workflows

Alternatively, register an extension that guarantees to call checkState
during the bad phase, run this in browser devtools and switch tabs:
```
window.app.registerExtension({
  name: 'bad',
  async afterConfigureGraph() {
    window.app.extensionManager.workflow.activeWorkflow.changeTracker.checkState()
  }
})
```

## Changes

- **What**: 
- Add loading graph flag
- Prevent checkState calls while loading
- Prevent app mode data sync while loading

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9531-fix-Prevent-corruption-of-workflow-data-due-to-checkState-during-graph-loading-31c6d73d365081e2ab91d9145bf1d025)
by [Unito](https://www.unito.io)
@christian-byrne christian-byrne requested a review from a team as a code owner March 8, 2026 02:11
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 8, 2026
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

🎭 Playwright: ✅ 556 passed, 0 failed · 2 flaky

📊 Browser Reports
  • chromium: View Report (✅ 543 / ❌ 0 / ⚠️ 2 / ⏭️ 10)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 10 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2026

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (2)
  • [release]
  • [backport

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 75cd9db7-f0aa-42a2-bc9d-3166337aab79

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch backport-9531-to-core-1.41

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 03/08/2026, 02:13:02 AM UTC

Links

@github-actions
Copy link

github-actions bot commented Mar 8, 2026

⚡ Performance Report

No baseline found — showing absolute values.

Metric Value
canvas-idle: style recalcs 123
canvas-idle: layouts 0
canvas-idle: task duration 391ms
canvas-idle: heap delta -3.7 MB
canvas-mouse-sweep: style recalcs 179
canvas-mouse-sweep: layouts 12
canvas-mouse-sweep: task duration 950ms
canvas-mouse-sweep: heap delta -3.4 MB
dom-widget-clipping: style recalcs 42
dom-widget-clipping: layouts 0
dom-widget-clipping: task duration 357ms
dom-widget-clipping: heap delta 7.1 MB
subgraph-dom-widget-clipping: style recalcs 73
subgraph-dom-widget-clipping: layouts 0
subgraph-dom-widget-clipping: task duration 411ms
subgraph-dom-widget-clipping: heap delta -8.2 MB
subgraph-idle: style recalcs 122
subgraph-idle: layouts 1
subgraph-idle: task duration 384ms
subgraph-idle: heap delta -3.1 MB
subgraph-mouse-sweep: style recalcs 165
subgraph-mouse-sweep: layouts 16
subgraph-mouse-sweep: task duration 864ms
subgraph-mouse-sweep: heap delta -5.3 MB
Raw data
{
  "timestamp": "2026-03-08T02:16:12.700Z",
  "gitSha": "eb86534fe1a483c77fb3c6553486c688ef6f1b16",
  "branch": "backport-9531-to-core-1.41",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2024.180000000058,
      "styleRecalcs": 123,
      "styleRecalcDurationMs": 19.387,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 376.076,
      "heapDeltaBytes": -3973580
    },
    {
      "name": "canvas-idle",
      "durationMs": 2023.1850000000122,
      "styleRecalcs": 122,
      "styleRecalcDurationMs": 18.478,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 394.9440000000001,
      "heapDeltaBytes": -3976804
    },
    {
      "name": "canvas-idle",
      "durationMs": 2025.865000000067,
      "styleRecalcs": 123,
      "styleRecalcDurationMs": 22.536,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 402.784,
      "heapDeltaBytes": -3721308
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1910.050999999953,
      "styleRecalcs": 176,
      "styleRecalcDurationMs": 49.221000000000004,
      "layouts": 12,
      "layoutDurationMs": 3.56,
      "taskDurationMs": 863.8430000000002,
      "heapDeltaBytes": -4051572
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 2015.6379999999672,
      "styleRecalcs": 178,
      "styleRecalcDurationMs": 47.119,
      "layouts": 12,
      "layoutDurationMs": 3.0660000000000003,
      "taskDurationMs": 974.4150000000001,
      "heapDeltaBytes": -3752384
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 2036.2119999999777,
      "styleRecalcs": 183,
      "styleRecalcDurationMs": 53.399,
      "layouts": 13,
      "layoutDurationMs": 3.281,
      "taskDurationMs": 1010.9189999999999,
      "heapDeltaBytes": -2762528
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 598.6660000000938,
      "styleRecalcs": 44,
      "styleRecalcDurationMs": 12.865000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 382.78000000000003,
      "heapDeltaBytes": 7505132
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 527.3260000000164,
      "styleRecalcs": 39,
      "styleRecalcDurationMs": 12.446,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 338.727,
      "heapDeltaBytes": 7045188
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 585.456000000022,
      "styleRecalcs": 42,
      "styleRecalcDurationMs": 11.857,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 349.74000000000007,
      "heapDeltaBytes": 7894944
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 594.6780000000444,
      "styleRecalcs": 75,
      "styleRecalcDurationMs": 17.698999999999998,
      "layouts": 1,
      "layoutDurationMs": 0.27200000000000013,
      "taskDurationMs": 417.203,
      "heapDeltaBytes": -7912568
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 581.3950000000432,
      "styleRecalcs": 72,
      "styleRecalcDurationMs": 14.184,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 409.6500000000001,
      "heapDeltaBytes": -8850292
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 587.8989999999931,
      "styleRecalcs": 72,
      "styleRecalcDurationMs": 15.28,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 407.225,
      "heapDeltaBytes": -8885636
    },
    {
      "name": "subgraph-idle",
      "durationMs": 1991.233999999963,
      "styleRecalcs": 120,
      "styleRecalcDurationMs": 20.269000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 383.27500000000003,
      "heapDeltaBytes": -3676340
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2011.0280000000103,
      "styleRecalcs": 123,
      "styleRecalcDurationMs": 23.278,
      "layouts": 1,
      "layoutDurationMs": 0.2790000000000001,
      "taskDurationMs": 386.121,
      "heapDeltaBytes": -3085576
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2009.7099999999273,
      "styleRecalcs": 123,
      "styleRecalcDurationMs": 21.845999999999997,
      "layouts": 1,
      "layoutDurationMs": 0.24399999999999997,
      "taskDurationMs": 383.749,
      "heapDeltaBytes": -3005088
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1977.1449999999504,
      "styleRecalcs": 171,
      "styleRecalcDurationMs": 50.394,
      "layouts": 16,
      "layoutDurationMs": 3.8389999999999995,
      "taskDurationMs": 949.7249999999999,
      "heapDeltaBytes": -5116656
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1679.3349999999236,
      "styleRecalcs": 154,
      "styleRecalcDurationMs": 42.49,
      "layouts": 16,
      "layoutDurationMs": 4.116999999999999,
      "taskDurationMs": 695.743,
      "heapDeltaBytes": -6278828
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1963.602999999921,
      "styleRecalcs": 170,
      "styleRecalcDurationMs": 49.77,
      "layouts": 16,
      "layoutDurationMs": 4.3500000000000005,
      "taskDurationMs": 946.0509999999999,
      "heapDeltaBytes": -5150148
    }
  ]
}

@christian-byrne christian-byrne merged commit 1fc437b into core/1.41 Mar 8, 2026
32 checks passed
@christian-byrne christian-byrne deleted the backport-9531-to-core-1.41 branch March 8, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants