Commit 9d5aeb1
authored
fix: prevent infinite loop between UniqueID and TrailingNode extensions (#7202)
This resolves an issue where using UniqueID and TrailingNode extensions
together caused an infinite transaction loop, freezing browser tabs.
The problem occurred because:
1. TrailingNode would insert a trailing node
2. UniqueID would add an ID to that node via setNodeMarkup
3. TrailingNode would see the document change and re-evaluate
4. This triggered another insertion, creating an infinite loop
The fix introduces a transaction metadata flag (__uniqueIDTransaction)
that UniqueID sets on its transactions. TrailingNode now checks for this
flag and skips re-evaluation for UniqueID transactions, breaking the loop
while preserving correct behavior for both extensions.
Fixes #68701 parent 50e8905 commit 9d5aeb1
File tree
3 files changed
+17
-1
lines changed- .changeset
- packages
- extension-unique-id/src
- extensions/src/trailing-node
3 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
249 | 253 | | |
250 | 254 | | |
251 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
0 commit comments