Closed Bug 530998 Opened 15 years ago Closed 3 years ago

Please work with the TinyMCE devs so TinyMCE tells Fx when to restore saved text after a crash or after saving session

Categories

(Firefox :: Session Restore, defect)

x86
Windows Vista
defect
Not set
critical

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: jasonspiro4, Unassigned, NeedInfo)

References

()

Details

(Keywords: dataloss)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)

There are two ways to trigger this bug:  A) closing Firefox and saving your session, or B) making Firefox crash.  It's easier to do A), so that is the method I will describe below.

Reproducible: Always

Steps to Reproduce:
1.  Visit http://tinymce.moxiecode.com/examples/full.php or https://www.assembla.com/wiki/edit/testing_space/bJqrJC2xur3RbReJe5aVNr
2.  Add some text to the text editing box, but don't click "Submit" or "Save changes"
3.  Close Firefox and choose "Save and Quit" to save your tabs for the next time Firefox starts
Actual Results:  
The new text you added to the text editing box is lost.

Expected Results:  
All the changes you made to the text editing box should be preserved.

This is unexpected.  Fx seems to save the contents of most TEXTAREAs for me -- for example, http://www.htmlref.com/examples/chapter12/textarea.html -- when I quit.  So it is surprising for it not to save the contents of the TinyMCE text editing box.

This bug is especially bad in cases of B), when the browser crashes.
I first reported this an hour or so ago on irc://irc.mozilla.org/firefox ; eventually kbrosnan replied:

<kbrosnan> looks like the page is initialized each time you visit it
<kbrosnan> i'd be more interested in a blank testcase
...
<kbrosnan> actually firefox should remember the fields just opening and closing
<kbrosnan> data:text/html,<textarea></textarea> type something, restart firefox for example

He then quit before I had a chance to respond.  I won't commit myself to making up a testcase, but how could I make up a blank testcase that includes TinyMCE in the testcase?
Keywords: dataloss
you really can't get this to work.
Component: Editor → Session Restore
Product: Core → Firefox
QA Contact: editor → session.restore
Version: unspecified → 3.5 Branch
timeless, why is it impossible to get this to work?

P.S.  Also repro'd in the latest trunk nightly -- Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a1pre) Gecko/20091125 Minefield/3.7a1pre (.NET CLR 3.5.30729) -- using http://tinymce.moxiecode.com/examples/full.php

P.P.S.  I should never have even mentioned www.assembla.com, since it's an https site and I don't know if Session Restore *ever* saves form information from it.
Version: 3.5 Branch → Trunk
so, there's a pref to enable saving ssl content, but yeah by default we don't.

the branch tag is because that's what you reported (it's bookkeeping)

the impossible bit is because we can't really decide when to do insertions of data.

a web page can mutate at any random time. and short of sessionrestore listening and logging each mutation point and then waiting for the equivalent set before reinserting data (which will likely include waiting for timers that would never fire), you can't properly decide when to insert the data.

thus, if the web page does a write into itself to initialize things, and that squashes the stuff session restore wants to insert, or if the web page inserts the target fields after session restore fails to find them, ... session restore just can't do what you want.

-- i spent a couple of years working on this problem (we actually made a commercial product out of it) --

Now, what i'd probably like and what might work for you, is for session restore to provide a sidebar with all of the content that it was trying to restore, akin to MSWord's unsaved documents panel. Anyway, that'd certainly satisfy my needs.
Ah.  Now I've tried Textarea Cache[1] with TinyMCE and I see it can restore saved TinyMCE data when I request it to.

For TinyMCE data restoration cases:  If the TinyMCE developers and the Fx developers worked together, would they be able to change things so that TinyMCE can tell Fx when it is time to restore the saved text?

For non-TinyMCE cases:  Would my Bug 530027, "Please integrate the "Textarea Cache" form-saving extension into Firefox", cover all non-TinyMCE cases?  Would it be the best way to deal with such cases?  As for your sidebar idea:  That's a good idea, but it would take a lot of screen space.  Wouldn't a yellow infobar be enough?

^  [1].  You can get the Textarea Cache extension at https://addons.mozilla.org/firefox/addon/5761
i'm not picky, an infobar could work. the only thing is that it's possible to have multiple independent text areas in a view, and i'd want reasonable access to the data from each, offhand i can't see an infobar as providing that, otoh if it drops down a panel with them, then sure....

re 'when to restore', um, sure, in theory we could come up w/ a way to do it, but it'd be kinda strange and we'd probably have to analyze any such solution for security risks (i can't think of anything now, but earlier during my business day I was involved in a review where someone claimed that a certain task had no security risk and I complained that he missed huge things, so i'm not going to be foolish enough as to say there is no risk).
Thanks timeless.  I'm changing this bug's summary.
       Old summary:  "My writings written in TinyMCE are lost when Fx saves and restores a session, whether after I close it or after it crashes".
       New summary:  "Please work with the TinyMCE devs so TinyMCE tells Fx when to restore saved text after a crash or after saving session".
Summary: My writings written in TinyMCE are lost when Fx saves and restores a session, whether after I close it or after it crashes → Please work with the TinyMCE devs so TinyMCE tells Fx when to restore saved text after a crash or after saving session

Hey Jason,
Can you still reproduce this issue or can we close it?

Flags: needinfo?(jasonspiro4)

Marking this as Resolved > Incomplete due to the lack of info.
If anyone is able to reproduce this issue re-open it or file a new bug.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.