Recursion in drag&drop events when using sync XHR with e10s

NEW
Unassigned

Status

()

P3
normal
a year ago
10 months ago

People

(Reporter: jean-christophe.voogden, Unassigned)

Tracking

54 Branch
Points:
---

Firefox Tracking Flags

(firefox56 wontfix, firefox57 wontfix, firefox58 wontfix, firefox59 ?)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0
Build ID: 20170628075643

Steps to reproduce:

We are using sync xhr events in html5 drag and drop (since application object state is stored server side). This leaves to unexpected recursion if e10s is activated, more easily with dragleave events.

This problem does not appear if e10s is desactivated (browser.tabs.remote.autostart.2 = false), nor with other browers.


Actual results:

We got recursion and stack overflows on the firefox side :

    dragleave()
    syncXhr()
    dragleave()
    syncXhr()
    dragleave()
    syncXhr()
    ...

Also our server does not expect to handle multiple synchron events at the same time from a single session which leads to unexpected effects. Applications do not expect to receive "out of band" events too...

Another symptom is that in some cases we receive drag event with null dataTransfer


Expected results:

No recursion should occur until the event has returned, and there should be only one dragleave event emitted. The dataTransfer should never be null.
Component: Untriaged → Drag and Drop
(Reporter)

Comment 1

a year ago
Created attachment 8900273 [details]
test case reproducing the problem

Ia added a test case reproducing the problem. It works ok if e10s is disabled but crashes rapidly if e10s is enabled, with "too much recursion" errors or "TypeError: event.dataTransfer is null".
This is likely some issue with using synchronous event loops while dragging, which shouldn't be done.
Status: UNCONFIRMED → NEW
status-firefox56: --- → wontfix
status-firefox57: --- → wontfix
status-firefox58: --- → fix-optional
Ever confirmed: true
Priority: -- → P3
(Reporter)

Comment 3

a year ago
Hello,

we are aware of the polemic about using synchronous queries in the main thread. However, this used to work correctly in previous versions and in others browers.

In our case the whole application state and logic is handled server side, specifically the server applications responds to questions like "there is something to drag" or "you can drop here".

I don't know how to implement this without using synchronous xhr... As far as I know you cannot set the dataTransfer (effectAllowed) in a promise...

In fact the drag&drop functionnality is the main reason for us to use sync xhr. In most case, we send asynchronous (ackaeable) events over a websocket.

Regards,
You need to log in before you can comment on or make changes to this bug.