Closed Bug 892357 Opened 7 years ago Closed 7 years ago

Followup to bug 890454 - [Homescreen] The save-bookmark screen doesn't work fine when "Add to Home Screen" button is pressed continuously.

Categories

(Firefox OS Graveyard :: Gaia::Homescreen, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(blocking-b2g:leo+, b2g18 fixed, b2g-v1.1hd fixed)

VERIFIED FIXED
1.1 QE4 (15jul)
blocking-b2g leo+
Tracking Status
b2g18 --- fixed
b2g-v1.1hd --- fixed

People

(Reporter: jsmith, Assigned: crdlc)

References

Details

(Whiteboard: [TD-58217], [LeoVB+])

Attachments

(3 files, 2 obsolete files)

Followup to bug 890454. Apparently https://bugzilla.mozilla.org/show_bug.cgi?id=890454#c12 reveals this is still reproducible even with the patch included.
Blocks: 890454
blocking-b2g: --- → leo?
Assignee: nobody → crdlc
Status: NEW → ASSIGNED
Attached file Patch v2 (obsolete) —
Attachment #773829 - Flags: review?(francisco.jordano)
Comment on attachment 773829 [details]
Patch v2

Please could you test it before landing? Thanks
Attachment #773829 - Flags: feedback?(cschmoeckel)
Severity: normal → critical
blocking-b2g: leo? → leo+
Priority: -- → P1
Whiteboard: [TD-58217]
Target Milestone: --- → 1.1 QE4 (15jul)
When I apply the "Patch v2", same issue is reproduced...
Please check it again..
Sorry but I don't understand anything :( If you see the patch, the listener for the save button is removed the first time, I mean, with the first click is received:

save: function bookmarkEditor_save(evt) {
    this.addButton.removeEventListener('click', this.saveListener);
Umm interesting, in v1-train there is not this code

https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/js/bookmark.js#L50

document.getElementById('bookmark-form').onsubmit = function() {
      return false;
    };
Attached patch Patch v3 (obsolete) — Splinter Review
Attachment #773829 - Attachment is obsolete: true
Attachment #773829 - Flags: review?(francisco.jordano)
Attachment #773829 - Flags: feedback?(cschmoeckel)
Attachment #773903 - Flags: feedback?
Could you test the patch v3?
Flags: needinfo?(leo.bugzilla.gaia)
When I apply v3 patch, same issue is reproduced.
I inserted the log in homescreen and test, I found some info

When issue is occured, 
1. If user select "Add to Home Screen", save and close function are not run.
2. If user select "Add to Home Screen", below log is occured 

/GeckoConsole(17563): [JavaScript Error: "document.getElementById(...) is null" {file: "app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js" line: 134}]
E/GeckoConsole(17563): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: '[JavaScript Error: "document.getElementById(...) is null" {file: "app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js" line: 134}]' when calling method: [nsIDOMSystemMessageCallback::handleMessage]" {file: "jar:file:///system/b2g/omni.ja!/components/SystemMessageManager.js" line: 97}]
E/GeckoConsole(17563): [JavaScript Warning: "Expected pseudo-element but found '-moz-placeholder'.  Ruleset ignored due to bad selector." {file: "app://homescreen.gaiamobile.org/shared/style/input_areas.css" line: 40}]

Please check these information
Flags: needinfo?(leo.bugzilla.gaia)
Hi Leo,

   I apologize for this problem but I cannot reproduce in my Unagi. This problem is very revealing, there is a race condition, sometimes the BookmarkEditor component is loaded before the DOM and pumm! If you test the new patch [1], at least the race condition should disappear and maybe the editor could finally work fine. Sorry again but it is very difficult to fix something what someone cannot reproduce by himself.

Thanks

[1] https://github.com/mozilla-b2g/gaia/pull/10936.patch
Flags: needinfo?(leo.bugzilla.gaia)
(In reply to Cristian Rodriguez de la Cruz (:crdlc) from comment #9)
> Hi Leo,

   I apologize for this problem but I cannot reproduce in my Unagi.
> This problem is very revealing, there is a race condition, sometimes the
> BookmarkEditor component is loaded before the DOM and pumm! If you test the
> new patch [1], at least the race condition should disappear and maybe the
> editor could finally work fine. Sorry again but it is very difficult to fix
> something what someone cannot reproduce by himself.

When I apply comme9 patch, same issue is reproduced. But more rarely.

And other log is occured

E/GeckoConsole(23960): [JavaScript Error: "document.location is null" {file: "app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js" line: 134}]
E/GeckoConsole(23960): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: '[JavaScript Error: "document.location is null" {file: "app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js" line: 134}]' when calling method: [nsIDOMSystemMessageCallback::handleMessage]" {file: "jar:file:///system/b2g/omni.ja!/components/SystemMessageManager.js" line: 97}]
E/GeckoConsole(23960): [JavaScript Warning: "Expected pseudo-element but found '-moz-placeholder'.  Ruleset ignored due to bad selector." {file: "app://homescreen.gaiamobile.org/shared/style/input_areas.css" line: 40}]
Flags: needinfo?(leo.bugzilla.gaia)
I am lost right now :) I don't know how document.location is null, it is a pain on the neck  jejeje

this.origin = document.location.protocol + '//homescreen.' +
      document.location.host.replace(/(^[\w\d]+.)?([\w\d]+.[a-z]+)/, '$2');
one question, is this trace before clicking or after?
Please, I've changed the patch a bit and added some traces, could you test it again?

https://github.com/mozilla-b2g/gaia/pull/10936.patch

Thanks a lot
Same issue is occured. I attach log

E/GeckoConsole(27269): Content JS LOG at app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js:137 in onActivity: The origin is: app://homescreen.gaiamobile.org
E/GeckoConsole(27269): [JavaScript Warning: "Expected pseudo-element but found '-moz-placeholder'.  Ruleset ignored due to bad selector." {file: "app://homescreen.gaiamobile.org/shared/style/input_areas.css" line: 40}]
E/GeckoConsole(27269): Content JS LOG at app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js:137 in onActivity: The origin is: app://homescreen.gaiamobile.org
E/GeckoConsole(27269): [JavaScript Error: "TypeError: this.oncancelled is not a function" {file: "app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js" line: 134}]
E/GeckoConsole(27269): [JavaScript Warning: "Expected pseudo-element but found '-moz-placeholder'.  Ruleset ignored due to bad selector." {file: "app://homescreen.gaiamobile.org/shared/style/input_areas.css" line: 40}]

Please check log. other log is occured also.
please strs?
And sometimes, 

E/GeckoConsole(28643): [JavaScript Error: "document.location is null" {file: "app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js" line: 136}]
E/GeckoConsole(28643): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: '[JavaScript Error: "document.location is null" {file: "app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js" line: 136}]' when calling method: [nsIDOMSystemMessageCallback::handleMessage]" {file: "jar:file:///system/b2g/omni.ja!/components/SystemMessageManager.js" line: 97}]

These logs are shown.
When this case is occured, 

When I insert below log, document.location is null.

save-bookmark.js : 
=========================================
console.log("document.location : " + document.location);
if (data.type === 'url') {
  var origin = document.location.protocol + '//homescreen.' +
               document.location.host.
               replace(/(^[\w\d]+.)?([\w\d]+.[a-z]+)/, '$2');
  console.log('The origin is: ' + origin);
=========================================
Try it the last time

https://github.com/mozilla-b2g/gaia/pull/10936.patch

If the bug is still reproducible, maybe the problem is not in homescreen's code and other person could fix it

Thanks
Flags: needinfo?(leo.bugzilla.gaia)
Attached image New issue
I apply this patch, this issue is not reproduced.

But new issue is occured. Check the image.

And device is changed this state, cannot close screen. Only can go home.(x button is not run)

Please check
Flags: needinfo?(leo.bugzilla.gaia)
STR? When does it happen?
I perform same. But, it is rarely occured. I test about 1~200 times, new issue is occured 2~3 times
Log is : 

E/GeckoConsole(  483): Content JS LOG at app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js:137 in onActivity: The origin is: app://homescreen.gaiamobile.org
E/GeckoConsole(  483): Content JS LOG at app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js:134 in bookmarkEditor_save: The save button was clicked
E/GeckoConsole(  483): [JavaScript Warning: "Expected pseudo-element but found '-moz-placeholder'.  Ruleset ignored due to bad selector." {file: "app://homescreen.gaiamobile.org/shared/style/input_areas.css" line: 40}]
E/GeckoConsole(  483): Content JS LOG at app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js:137 in onActivity: The origin is: app://homescreen.gaiamobile.org
E/GeckoConsole(  483): Content JS LOG at app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js:134 in bookmarkEditor_save: The save button was clicked
E/GeckoConsole(  483): [JavaScript Warning: "Expected pseudo-element but found '-moz-placeholder'.  Ruleset ignored due to bad selector." {file: "app://homescreen.gaiamobile.org/shared/style/input_areas.css" line: 40}]
E/GeckoConsole(  483): Content JS LOG at app://homescreen.gaiamobile.org/gaia_build_save-bookmark.js:137 in onActivity: The origin is: app://homescreen.gaiamobile.org

In this case, I don't search problem in logs...
I am writing a lot of traces in order to know what's happen when it fails. Although the first time it works fine, right? Thanks
Ready

https://github.com/mozilla-b2g/gaia/pull/10936.patch

Thanks for your great help!
Flags: needinfo?(leo.bugzilla.gaia)
Please make sure that this code:

document.readyState === 'interactive

is available in the patch what you are testing right now

Thanks a lot
I test 200 times, original issue and new issue are not reproduced.
I think issue is fixed.

Thanks for your help!
Flags: needinfo?(leo.bugzilla.gaia)
Thanks to you!! I couldn't fix it without your help
Attachment #773903 - Attachment is obsolete: true
Attachment #773903 - Flags: feedback?
Attachment #774578 - Flags: review?(jmcf)
Attached file Patch v1
Attachment #774589 - Flags: review?(jmcf)
Attachment #774589 - Flags: review?(jmcf) → review+
Attachment #774578 - Flags: review?(jmcf) → review+
Whiteboard: [TD-58217] → [TD-58217], [LeoVB+]
Not able to reproduce this bug with unagi v1-train 07/19 build:
Gecko-6b60535
Gaia-4abea64
ref ril
Status: RESOLVED → VERIFIED
v1.1.0hd: 55ed5e08a2250ea2d3571fff860c39e66fabed14
v1.1.0hd: bd6659f4c2cb03e09d5ce5bda54a92d2015b9ec5
You need to log in before you can comment on or make changes to this bug.