Closed peternedap closed 2 years ago
Thanks for the detailed report! I am currently enjoying COVID, so I hopefully will take a look a bit later.
I did not reproduce the reported behaviour but applied a fix to ignore messages originated by someone else as you suggested. It would be nice if you could check if it works for you.
Thank you for your quick reply. The new version works for me :)
I would suggest changing
console.log(`Message with bad signature: ${msg}`)
to
console.log(`Message with bad signature:`, msg);
to prevent getting Message with bad signature: [object Object]
messages
You are right, will fix it now.
When the
msg.data.type
of awindow.onmessage
event does not matchDxfWorker.WorkerMsg.LOAD
orDxfWorker.WorkerMsg.DESTROY
,DxfWorker._ProcessRequest
will post a response that seems to retrigger the same error flow, resulting in an infinite loop.This flow is triggered for me when using the webpack dev server, which posts a message when a hot reload is performed, as well as when using vue dev tools, which post a message when the plugin is initialized.
A possible solution to this would be creating a way to recognize onmessage events that are created by dxf-viewer so those from other sources can be ignored, maybe a message type prefix or a specific field in the data?