Opened 8 years ago
Closed 8 years ago
#16233 closed defect (fixed)
[patch][cla] dojox/analytics throws a leave page/stay on the same page error on chrome
Reported by: | dylan | Owned by: | dylan |
---|---|---|---|
Priority: | high | Milestone: | 1.8.2 |
Component: | Dojox | Version: | 1.8.1 |
Keywords: | Cc: | Dustin Machi, Kenneth G. Franqueiro | |
Blocked By: | Blocking: |
Description
the dojox/analytics/tests/test_analytics.html page will throw the following dialog when clicking on the links:
[object Object]
Are you sure you want to leave this page?
This appears to be related to how we return a promise, and how we handle this promise in checkData and pushData, and finally the call to unload.addOnUnload(this, "pushData", true);
We can either change pushData to not return a promise, and use a reference to the promise, or we could bind something different to the unload handler that doesn't use a promise.
Attachments (2)
Change History (7)
Changed 8 years ago by
Attachment: | 16233.patch added |
---|
comment:1 Changed 8 years ago by
Status: | new → assigned |
---|---|
Summary: | dojox/analytics throws a leave page/stay on the same page error on chrome → [patch][cla] dojox/analytics throws a leave page/stay on the same page error on chrome |
Added a patch against trunk. This needs a review. While this works, I'm not sure this is ideal.
comment:2 Changed 8 years ago by
I'm no expert with this code, but I'm wondering why handleAs: "json"
was added to the requests - seems like that could be changing behavior, and is unrelated to the fix? IIUC the focus of the fix is the introduction of promiseRef
instead of returning a promise from pushData
(which is what's causing the popup message, since pushData
is hooked on onbeforeunload
).
Also, you can remove the now-commented old return statements, no sense keeping them there.
comment:4 Changed 8 years ago by
Ken's patch passes tests and is much simpler, I've committed to trunk. Will also backport to 1.8.x.
Patch file that stops returning a promise to address Google Analytics issue