Skip to content

Commit 481fddf

Browse files
committed
bug: Fix TimelineCanvas regression by passing componentId through triangular communication (#9503)
1 parent 26ce749 commit 481fddf

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/component/Canvas.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ class Canvas extends Component {
7373
});
7474

7575
Neo.main.DomAccess.transferCanvasToWorker({
76-
nodeId: id,
76+
componentId: me.id,
77+
nodeId : id,
7778
windowId
7879
});
7980

src/main/DomAccess.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,10 +1129,10 @@ class DomAccess extends Base {
11291129
* By calling this method, the Main Thread extracts the canvas and sends it directly to the Canvas Worker, bypassing the App Worker entirely for the buffer transfer.
11301130
*
11311131
* @param {Object} data
1132-
* @param {String} data.id
1132+
* @param {String} data.componentId
11331133
* @param {String} data.nodeId
11341134
*/
1135-
transferCanvasToWorker({nodeId}) {
1135+
transferCanvasToWorker({componentId, nodeId}) {
11361136
let me = this,
11371137
node = me.getElement(nodeId);
11381138

@@ -1142,6 +1142,7 @@ class DomAccess extends Base {
11421142

11431143
Neo.worker.Manager.sendMessage('canvas', {
11441144
action: 'registerCanvasDirect',
1145+
componentId,
11451146
node : offscreen,
11461147
nodeId
11471148
}, [offscreen])

src/worker/App.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,12 @@ class App extends Base {
548548
* to avoid transfer restrictions in Firefox SharedWorkers.
549549
*
550550
* @param {Object} msg
551+
* @param {String} msg.componentId
551552
* @param {String} msg.nodeId
552553
* @protected
553554
*/
554-
onCanvasRegistered({nodeId}) {
555-
let instance = Neo.get(nodeId);
555+
onCanvasRegistered({componentId, nodeId}) {
556+
let instance = Neo.get(componentId);
556557

557558
if (instance?.registerCanvasCallbacks?.[nodeId]) {
558559
instance.registerCanvasCallbacks[nodeId]();

src/worker/Canvas.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ class Canvas extends Base {
158158

159159
// Ping App worker that canvas was received from main.
160160
this.sendMessage('app', {
161-
action: 'canvasRegistered',
162-
nodeId: msg.nodeId
161+
action : 'canvasRegistered',
162+
componentId: msg.componentId,
163+
nodeId : msg.nodeId
163164
})
164165
}
165166

0 commit comments

Comments
 (0)