Opened 5 years ago

Closed 4 years ago

#18155 closed defect (fixed)

[CLA][PATCH] aspect stop working after a while (when multiple dojo version)

Reported by: ido Owned by: dylan
Priority: undecided Milestone: 1.8.11
Component: Core Version: 1.10.0
Keywords: Cc:
Blocked By: Blocking:

Description

Since the introduction of the fix for #13743, aspect is dependent on an id. In case of multiple dojo version, each instance of dojo increment a different id. If 2 (or more) dojo instance attach the same event on the same domnode, the id used as reference (executionId) will be the one coming from the dojo instance attached first but the id linked to the dispatcher is the one from the dojo instance that attach the event. So at some point, the attached id is higher than the executionId and the chain is broken.

For instance: dojo1 nextId is 0 (initial value) dojo1 attach to document[mousemove]. The attached dispatcher has the id 0 dojo1 nextId is now 1 dojo2 nextId is 0 (initial value) dojo2 attach to document[mousemove]. The attached dispatcher has the id 0 dojo2 nextId is now 1 dojo2 attach again to document[mousemove]. The attached dispatcher has the id 1 dojo2 nextId is now 2

Now, document[mousemove] is fired. Aspect will run the first dispatcher. executionId is 1 (coming from dojo1) first dispatcher id is 0. It runs. Then aspect check what is after and get the 1st event attached by dojo2. second dispatcher id is 0 again. It runs. Then aspect check what is after and get the 2nd event attached by dojo2. third dispatcher id is 1. it will not run because it is not lower than executionId.

Here is a pull request for fixing this issue: https://github.com/dojo/dojo/pull/102

Maybe this can be backported...

Change History (3)

comment:1 Changed 4 years ago by bill

Milestone: tbd1.8.11
Owner: set to dylan
Status: newassigned

Strangely, clicking #13743 leads to an error, but I traced the commit to https://github.com/dojo/dojo/commit/080b4982a95592ce7a2a295d6a00a554c2076db4.

This is a regression starting in 1.8, so the fix should be backported to 1.8.

Assigning to Dylan since he assigned the PR to himself.

Note: See TracTickets for help on using tickets.