Closed Bug 949905 Opened 11 years ago Closed 11 years ago

[fugu][buri] a white screen appears after tapping on "Passcode Lock" multiple times

Categories

(Firefox OS Graveyard :: Gaia::Settings, defect)

Other
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:fugu+, b2g-v1.3 affected)

RESOLVED FIXED
blocking-b2g fugu+
Tracking Status
b2g-v1.3 --- affected

People

(Reporter: angelc04, Assigned: jesse.ji)

Details

Attachments

(3 files, 2 obsolete files)

Attached video STR.3gp
This can be reproduced on both v1.2 and v1.3.

STR:
1. go to Settings -> Screen lock
2. Enable Lock screen
3. Quickly click "Passcode lock" for several times
   --> A white screen shows up.

Please see attached video for details.
transition was error if we click the screen during a transition.

In file settings.css,change transition time to 5s or more longer.
Would see the bug obviously.

section[role="region"] {
  visibility: hidden;
  transform: translateX(+100%);
  transition: transform 5s linear, visibility 5s linear;
}
Tzu-lin,

    We need prevent users from interrupting the transition of panels. Do you think it's a right way?

    Besides, we should wait until transition end to show keyboard , not immediately ( cause a significant white screen).
Attachment #8349157 - Flags: review?(tzhuang)
It's fugu v1.2 major bug.
blocking-b2g: --- → fugu?
Flags: needinfo?(ehung)
Flags: needinfo?(styang)
Evelyn, could you take a look on this issue?
Flags: needinfo?(styang)
blocking-b2g: fugu? → fugu+
(In reply to Jesse from comment #2)
> Created attachment 8349157 [details] [diff] [review]
> too_many_clicks_hang_up_settings.patch
> 
> Tzu-lin,
> 
>     We need prevent users from interrupting the transition of panels. Do you
> think it's a right way?
> 
I don't think we need this trick.

>     Besides, we should wait until transition end to show keyboard , not
> immediately ( cause a significant white screen).

The root case is here. yes, we need to wait panel transition finished to set input focus.
Flags: needinfo?(ehung)
Comment on attachment 8349157 [details] [diff] [review]
too_many_clicks_hang_up_settings.patch

Review of attachment 8349157 [details] [diff] [review]:
-----------------------------------------------------------------

I think we don't need `pointer-events: none` trick to prevent user input while panel is transitioning. Please keep panelready listener and callback but remove other modification. Thanks.

::: apps/settings/js/phone_lock.js
@@ +128,5 @@
>    },
>  
> +  onPasscodePanelLoad: function onPasscodePanelLoad(e){
> +    window.removeEventListener('panelready', onPasscodePanelLoad);
> +    if (e.detail.current === '#phoneLock-passcode' && Settings.currentPanel === '#phoneLock-passcode') {

`e.detail.current` and `Settings.currentPanel` should be always equal.

@@ +129,5 @@
>  
> +  onPasscodePanelLoad: function onPasscodePanelLoad(e){
> +    window.removeEventListener('panelready', onPasscodePanelLoad);
> +    if (e.detail.current === '#phoneLock-passcode' && Settings.currentPanel === '#phoneLock-passcode') {
> +      PhoneLock.passcodeInput.focus();

Try no using object name directly in the code.

@@ +137,5 @@
>    changeMode: function pl_changeMode(mode) {
>      this.hideErrorMessage();
>      this.MODE = mode;
>      this.passcodePanel.dataset.mode = mode;
> +    window.removeEventListener('panelready', this.onPasscodePanelLoad);

should remove event listener immediately after event is fired.

@@ -134,2 @@
>      if (Settings.currentPanel != '#phoneLock-passcode') {
> -      Settings.currentPanel = '#phoneLock-passcode'; // show dialog box

Why you remove this line?

@@ +142,4 @@
>      if (Settings.currentPanel != '#phoneLock-passcode') {
> +      window.addEventListener('panelready', this.onPasscodePanelLoad);
> +      Settings.currentPanel = '#phoneLock-passcode';
> +    } else {

There is no else case here, every time when the dialog shows, we need to listen to this `panelready` event.
Attachment #8349157 - Flags: review?(tzhuang) → review-
There is still a little possibility that the bug show up again , if we only defer the focus event.

Thus I add pointer-event to prevent any action from users to workaround the problem.

It's a gecko bug,but we need a workaround on v1.2 branch.

Sorry for the redundance in my patch, I will remove some lines if you agree with me on adding 'pointer-event'. Otherwise please find a better solution to fix the issue without adding 'pointer-event'.


(In reply to Evelyn Hung [:evelyn] from comment #6)
> Comment on attachment 8349157 [details] [diff] [review]
> too_many_clicks_hang_up_settings.patch
> 
> Review of attachment 8349157 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I think we don't need `pointer-events: none` trick to prevent user input
> while panel is transitioning. Please keep panelready listener and callback
> but remove other modification. Thanks.
> 
> ::: apps/settings/js/phone_lock.js
> @@ +128,5 @@
> >    },
> >  
> > +  onPasscodePanelLoad: function onPasscodePanelLoad(e){
> > +    window.removeEventListener('panelready', onPasscodePanelLoad);
> > +    if (e.detail.current === '#phoneLock-passcode' && Settings.currentPanel === '#phoneLock-passcode') {
> 
> `e.detail.current` and `Settings.currentPanel` should be always equal.
> 
> @@ +129,5 @@
> >  
> > +  onPasscodePanelLoad: function onPasscodePanelLoad(e){
> > +    window.removeEventListener('panelready', onPasscodePanelLoad);
> > +    if (e.detail.current === '#phoneLock-passcode' && Settings.currentPanel === '#phoneLock-passcode') {
> > +      PhoneLock.passcodeInput.focus();
> 
> Try no using object name directly in the code.
> 
> @@ +137,5 @@
> >    changeMode: function pl_changeMode(mode) {
> >      this.hideErrorMessage();
> >      this.MODE = mode;
> >      this.passcodePanel.dataset.mode = mode;
> > +    window.removeEventListener('panelready', this.onPasscodePanelLoad);
> 
> should remove event listener immediately after event is fired.
> 
> @@ -134,2 @@
> >      if (Settings.currentPanel != '#phoneLock-passcode') {
> > -      Settings.currentPanel = '#phoneLock-passcode'; // show dialog box
> 
> Why you remove this line?
> 
> @@ +142,4 @@
> >      if (Settings.currentPanel != '#phoneLock-passcode') {
> > +      window.addEventListener('panelready', this.onPasscodePanelLoad);
> > +      Settings.currentPanel = '#phoneLock-passcode';
> > +    } else {
> 
> There is no else case here, every time when the dialog shows, we need to
> listen to this `panelready` event.
(In reply to Jesse from comment #7)
> There is still a little possibility that the bug show up again , if we only
> defer the focus event.
> 

Can you explain more about the possibility? and if so, I guess the same problem happens on SIM pin panel.
It's a gecko issue that I have not dove into. So I can't give u an exact explanation about the possibility. But it does reproduce the issue if we only 
setup the correct focus action. 

I did many trials in gaia,finally I had no choice but to workaround it by preventing clicks while the transition.
Attachment #8349157 - Attachment is obsolete: true
Attachment #8349814 - Flags: review?(ehung)
(In reply to Jesse from comment #9)
> Created attachment 8349814 [details] [diff] [review]
> too_many_clicks_cause_settings_bad_ui.patch
> 
> It's a gecko issue that I have not dove into. So I can't give u an exact
> explanation about the possibility. But it does reproduce the issue if we
> only 
> setup the correct focus action. 

Not sure how much possibility of the problem is if we simply delay focus setting after panel ready. I also tried many times but failed to reproduce it. If it's a gecko issue, do we have a bug for tracking this?

Anyway, I'm fine to take this patch for v1.2f, but please note there is a risk - if the transitionend is failed to fire or catch, the panel will be locked and user have to kill Settings to workaround the issue.
Comment on attachment 8349814 [details] [diff] [review]
too_many_clicks_cause_settings_bad_ui.patch

Review of attachment 8349814 [details] [diff] [review]:
-----------------------------------------------------------------

Please address my comment below.

::: apps/settings/js/phone_lock.js
@@ +140,5 @@
>      this.hideErrorMessage();
>      this.MODE = mode;
>      this.passcodePanel.dataset.mode = mode;
>      if (Settings.currentPanel != '#phoneLock-passcode') {
> +      window.addEventListener('panelready', onPasscodePanelLoad);

Please add a comment to describe why we do this.

@@ +142,5 @@
>      this.passcodePanel.dataset.mode = mode;
>      if (Settings.currentPanel != '#phoneLock-passcode') {
> +      window.addEventListener('panelready', onPasscodePanelLoad);
> +      Settings.currentPanel = '#phoneLock-passcode';
> +    } else {

no else case here, please also remove the next line.
Attachment #8349814 - Flags: review?(ehung)
Attachment #8349814 - Flags: feedback+
1. We do have the else case here.  The older comments describe that sometimes we can't listen for the ontransitionend event because some of the passcode mode changes, such as edit->new, do not trigger transition events.
 
   if (Settings.currentPanel != '#phoneLock-passcode') {
      window.addEventListener('panelready', onPasscodePanelLoad);
      Settings.currentPanel = '#phoneLock-passcode';
    } else {
      setTimeout(function(self) { self.passcodeInput.focus(); }, 0, this);
    }

2. If we prevent users from touching anything,it's almost impossible that transitionend event failed to fire, at least it's harder to reproduce than the white screen issue. What do u think?
Add comments.
Attachment #8349814 - Attachment is obsolete: true
Attachment #8349938 - Flags: review?(ehung)
(In reply to Jesse from comment #12)
> 1. We do have the else case here.  The older comments describe that
> sometimes we can't listen for the ontransitionend event because some of the
> passcode mode changes, such as edit->new, do not trigger transition events.
>  
>    if (Settings.currentPanel != '#phoneLock-passcode') {
>       window.addEventListener('panelready', onPasscodePanelLoad);
>       Settings.currentPanel = '#phoneLock-passcode';
>     } else {
>       setTimeout(function(self) { self.passcodeInput.focus(); }, 0, this);
>     }
> 

By tracing the code, you will see in edit->new case, the keyboard never goes down, so I think it's no need to add this setTimeout. If you still want to, you should leave the comment intact.

> 2. If we prevent users from touching anything,it's almost impossible that
> transitionend event failed to fire, at least it's harder to reproduce than
> the white screen issue. What do u think?

"If we prevent users from touching anything,it's almost impossible that transitionend event failed to fire". To me, the statement is not correct. An event is failed to fire because of some reason, not only caused by user interrupt, but caused by going some wrong state in platform. I just raise my concern here.
Comment on attachment 8349938 [details] [diff] [review]
too_many_clicks_cause_settings_bad_ui.patch

Review of attachment 8349938 [details] [diff] [review]:
-----------------------------------------------------------------

r+ for v1.2f. Thanks!
Attachment #8349938 - Flags: review?(ehung) → review+
For master and v1.3
Attachment #8351306 - Flags: review?(arthur.chen)
(In reply to Evelyn Hung [:evelyn] from comment #15)
> Comment on attachment 8349938 [details] [diff] [review]
> too_many_clicks_cause_settings_bad_ui.patch
> 
> Review of attachment 8349938 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> r+ for v1.2f. Thanks!

Merged into v1.2f: https://github.com/mozilla-b2g/gaia/commit/5212c61900f7f9259badbbe946a34c1b65dd57bf
Comment on attachment 8351306 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/14947

r=me. Thanks for the patch.
Attachment #8351306 - Flags: review?(arthur.chen) → review+
merged into master: https://github.com/mozilla-b2g/gaia/commit/3e1a3a28ebae40191930f701f5786e5eebc3527b
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
This commit introduced a few syntax errors which is causing travis to be red. Can we land a follow-up or revert it?

https://travis-ci.org/mozilla-b2g/gaia/builds/15920779
Flags: needinfo?(ehung)
(In reply to Kevin Grandon :kgrandon from comment #20)
> This commit introduced a few syntax errors which is causing travis to be
> red. Can we land a follow-up or revert it?
> 
> https://travis-ci.org/mozilla-b2g/gaia/builds/15920779

I think you were talking the commit for v1.2f: 
https://github.com/mozilla-b2g/gaia/commit/5212c61900f7f9259badbbe946a34c1b65dd57bf

a follow lint patch merged: https://github.com/mozilla-b2g/gaia/commit/b33c428e6b4ca7e699c51c433fe23aaaa3c655f8

Sorry for making travis red. :(
Flags: needinfo?(ehung)
Assignee: nobody → jesse.ji
hi,Evelyn
  could you please cherry pick this patch to v1.3t? thank you!(In reply to Evelyn Hung [:evelyn] from comment #21)
> (In reply to Kevin Grandon :kgrandon from comment #20)
> > This commit introduced a few syntax errors which is causing travis to be
> > red. Can we land a follow-up or revert it?
> > 
> > https://travis-ci.org/mozilla-b2g/gaia/builds/15920779
> 
> I think you were talking the commit for v1.2f: 
> https://github.com/mozilla-b2g/gaia/commit/
> 5212c61900f7f9259badbbe946a34c1b65dd57bf
> 
> a follow lint patch merged:
> https://github.com/mozilla-b2g/gaia/commit/
> b33c428e6b4ca7e699c51c433fe23aaaa3c655f8
> 
> Sorry for making travis red. :(
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: