Last Comment Bug 652427 - Going back to the new bug page loses the description if possible duplicates have been searched for
: Going back to the new bug page loses the description if possible duplicates h...
Status: RESOLVED FIXED
: dataloss, regression
Product: Bugzilla
Classification: Server Software
Component: Creating/Changing Bugs (show other bugs)
: 4.0
: All All
: -- major (vote)
: Bugzilla 4.0
Assigned To: Guy Pyrzak
: default-qa
Mentors:
: 653834 (view as bug list)
Depends on:
Blocks: bmo-regressions
  Show dependency treegraph
 
Reported: 2011-04-24 07:39 PDT by Mark Banner (:standard8)
Modified: 2011-07-01 08:54 PDT (History)
10 users (show)
mkanat: approval+
mkanat: approval4.0+
mkanat: blocking4.0.2+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
v1 (692 bytes, patch)
2011-06-14 21:17 PDT, Guy Pyrzak
mkanat: review-
Details | Diff | Splinter Review
v2 (2.49 KB, patch)
2011-06-15 22:31 PDT, Guy Pyrzak
mkanat: review+
Details | Diff | Splinter Review

Description Mark Banner (:standard8) 2011-04-24 07:39:30 PDT
STR:

1) Create a new bug, with some field incorrect - e.g. a mismatching cc field
1a) Make sure to enter a summary which causes duplicates to be searched for
1b) Enter a description.
2) Hit Submit

=> You get the error about the mismatched cc.

3) Hit Back

=> You get the new bug page with everything filled in except for the description.

This is a really annoying dataloss situation that didn't used to happen.

It doesn't appear to happen if possible duplicates have already been searched for (e.g. following on from step 3, enter a description, hit submit, then hit back again and your text is still there).

I'm using FF 4 on Mac.
Comment 1 Frédéric Buclin 2011-04-24 16:22:55 PDT
I cannot reproduce your issue. When clicking Back, all the data is here.
Comment 2 Frédéric Buclin 2011-04-28 03:38:23 PDT
Can someone else besides the reporter reproduce this?
Comment 3 Byron Jones ‹:glob› 2011-04-28 08:57:48 PDT
works for me on firefox-aurora and ie9.
Comment 4 Frédéric Buclin 2011-04-28 14:48:00 PDT
Reopen if someone else can reproduce. It could be a problem with Mark's Fx4, e.g. due to an extension.
Comment 5 Frédéric Buclin 2011-04-30 04:04:28 PDT
*** Bug 653834 has been marked as a duplicate of this bug. ***
Comment 6 Justin Lebar (not reading bugmail) 2011-04-30 07:22:08 PDT
Reopening per comment 4.  I believe Myk reproduced with a clean profile.

See STR in bug 653834.  It takes some futsing.
Comment 7 Byron Jones ‹:glob› 2011-04-30 07:37:35 PDT
to reproduce this, first enter a summary to get the duplicates table populated, then fill in an invalid CC, and immediately hit 'submit bug'.

you have to hit 'submit bug' before the results are returned from the name auto-completion (watch it with firebug).

then when you go back, the duplicates table will be missing.
Comment 8 Max Kanat-Alexander 2011-05-03 18:56:29 PDT
(In reply to comment #7)
> then when you go back, the duplicates table will be missing.

  The duplicates table or the description that you entered in the comment? Losing a comment is data loss, losing the duplicates table is not.
Comment 9 Justin Lebar (not reading bugmail) 2011-05-03 19:07:25 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > then when you go back, the duplicates table will be missing.
> 
>   The duplicates table or the description that you entered in the comment?

Both.
Comment 10 Max Kanat-Alexander 2011-05-03 19:20:35 PDT
  pyrzak: This is another "stuff disappears that shouldn't when hitting Back" bug. Any input?
Comment 11 Justin Lebar (not reading bugmail) 2011-06-01 06:10:38 PDT
Any movement on this?  I've heard people complaining about it on IRC periodically, and I just hit it again.

Data loss like this is not acceptable.
Comment 12 Max Kanat-Alexander 2011-06-02 12:53:32 PDT
(In reply to comment #11)
> Data loss like this is not acceptable.

  Really? Gee, I thought it was high fashion. ;-) I fully agree with you that this is a serious issue that should be resolved as soon as we understand why it is happening. What's particularly odd is that YUI isn't touching the description field, so I have no idea why it would be missing data.

  Does it happen in all browsers, or just Firefox?
Comment 13 Justin Lebar (not reading bugmail) 2011-06-03 10:40:08 PDT
> Does it happen in all browsers, or just Firefox?

I did some testing at https://landfill.bugzilla.org/bugzilla-4.0-branch and was unable to reproduce in Chrome.

It seems that when Chrome goes back to the page, it refetches it, while we retrieve it from bfcache.
Comment 14 Guy Pyrzak 2011-06-14 21:17:19 PDT
Created attachment 539419 [details] [diff] [review]
v1

the bug is actually in Firefox/BFCache. BFCache can't handle dynamic form elements and basically breaks whenever a form element is present and then disappears on back. This is exactly what the dup table is doing by adding buttons and then removing them. The fix is simple, remove the buttons from the dup table. There might even be a bug on this since I recall running into this a long time ago.

This makes me sad from a design perspective, but it works and I don't want to add some funky UI that makes it look like a button for no reason. Tested on FF4.
Comment 15 Max Kanat-Alexander 2011-06-15 11:33:25 PDT
  Boris, could you perhaps confirm that the issue Guy describes above is indeed a bug in Gecko's bfcache?
Comment 16 Boris Zbarsky [:bz] 2011-06-15 11:39:31 PDT
bfcache has no problems with dynamic anything, since it just restores the exact DOM you had before (or more precisely it never gets rid of it).

Comment 14 sounds like a description of a known issue with out non-bfcache form state restoration.

That would be consistent with comment 7 paragraph 2 as well: the fact that a network request is outstanding will make us NOT bfcache the page and instead rely on normal form-state restoration stuff.

Jonas, we really need to fix form state restoration to be saner....
Comment 17 Max Kanat-Alexander 2011-06-15 12:23:08 PDT
Comment on attachment 539419 [details] [diff] [review]
v1

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

::: js/bug.js
@@ +88,5 @@
>      formatCcButton: function(el, oRecord, oColumn, oData) {
>          var url = 'process_bug.cgi?id=' + oRecord.getData('id') 
>                    + '&addselfcc=1&token=' + escape(oData);
> +        var button = document.createElement('a');
> +        button.setAttribute('href', "#");

I think that users do not expect an anchor to automatically perform a data-changing action for them, we'd be violating the Principle of Least Surprise in a fashion that modifies data--not a good idea.
Comment 18 Guy Pyrzak 2011-06-15 13:09:24 PDT
We're going to use http://developer.yahoo.com/yui/examples/button/btn_example02.html in response to the desire to have a button look but not a real button. I'll make sure to include all this in a comment as well.
Comment 19 Guy Pyrzak 2011-06-15 22:31:06 PDT
Created attachment 539723 [details] [diff] [review]
v2

now with fake buttons thanks to YUI.
Comment 20 Frédéric Buclin 2011-06-16 08:46:15 PDT
Comment on attachment 539723 [details] [diff] [review]
v2

>=== modified file 'template/en/default/global/header.html.tmpl'

>-[%# The contents of this file are subject to the Mozilla Public
>+  [%# The contents of this file are subject to the Mozilla Public

No reason to change the indentation.
Comment 21 Max Kanat-Alexander 2011-06-20 16:18:46 PDT
Comment on attachment 539723 [details] [diff] [review]
v2

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

Beautiful. Above the "new YUI.Button" bit, add a comment explaining why we're doing that and not using a standard HTML button.
Comment 22 Tushar 2011-06-24 12:49:41 PDT
Is there a workaround for people who are seeing it consistently using firefox 5.0 ?
Comment 23 Guy Pyrzak 2011-06-24 14:33:29 PDT
(In reply to comment #22)
> Is there a workaround for people who are seeing it consistently using
> firefox 5.0 ?

The bug is caused by hitting submit while an ajax call is happening. The easy thing to do is use firebug to see if something is being loaded or just waiting a bit after filling in the cc field or the summary. 

You could also use greasemonkey to replace the button with a hyperlink.

 I'm not sure how much effort you want to put into a work around. Another work around... BMO could just backport this patch sooner than later. It doesn't really use anything that fancy or dangerous.
Comment 24 Byron Jones ‹:glob› 2011-06-25 01:35:31 PDT
(In reply to comment #23)
>  I'm not sure how much effort you want to put into a work around. Another
> work around... BMO could just backport this patch sooner than later. It
> doesn't really use anything that fancy or dangerous.

once it's committed to 4.0 branch (hint!), BMO will pick up this fix.
Comment 25 Guy Pyrzak 2011-06-28 22:08:02 PDT
Committing to: bzr+ssh://guy.pyrzak%40gmail.com@bzr.mozilla.org/bugzilla/trunk/                                                                                                                               
modified js/bug.js
modified skins/standard/enter_bug.css
modified template/en/default/bug/create/create.html.tmpl
modified template/en/default/global/header.html.tmpl
Committed revision 7846. 

Committing to: bzr+ssh://guy.pyrzak%40gmail.com@bzr.mozilla.org/bugzilla/4.0/                                                                                                                                 
modified js/bug.js
modified skins/standard/enter_bug.css
modified template/en/default/bug/create/create.html.tmpl
modified template/en/default/global/header.html.tmpl
Committed revision 7608.
Comment 26 Frédéric Buclin 2011-07-01 08:54:44 PDT
Comment on attachment 539723 [details] [diff] [review]
v2

>=== modified file 'template/en/default/global/header.html.tmpl'

>-[%# The contents of this file are subject to the Mozilla Public
>+  [%# The contents of this file are subject to the Mozilla Public

I reverted this change, as the new intentation is wrong.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified template/en/default/global/header.html.tmpl
Committed revision 7847.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified template/en/default/global/header.html.tmpl
Committed revision 7609.

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