Closed Bug 959196 Opened 11 years ago Closed 11 years ago

[Messages][Drafts] Don't auto-save new draft when hiding app and then draft is discarded

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: evhan55, Assigned: evhan55)

References

Details

Attachments

(1 file)

The spec originally asked for this behavior, but the behavior is being altered. This bug was originally reported in bugs 952514 and 958103: https://bugzilla.mozilla.org/show_bug.cgi?id=958103#c10 STR: * open "new message" view * add some text in the composer * press home * press the "messages" icon * press back * press "discard draft" Expected: * no new draft Actual: * a new draft was created
Assignee: nobody → evelyn
I think the draft that was created should just be discarded when we get a visibilitychange event with document.hidden=false. Don't know how easy it is though ;)
(In reply to Julien Wajsberg [:julienw] from comment #1) > I think the draft that was created should just be discarded when we get a > visibilitychange event with document.hidden=false. Don't know how easy it is > though ;) The problem was happening because MessageManager.draft was not properly set if this brand new draft was auto-saved. Fixing that issue fixes this bug, so I think that may be a better fix in my opinion. I will feedback? you in any case. Thank you!
- `thread_ui.js` - If `MessageManager` is not already holding onto a draft when a brand new is auto-saved, then set it. this way preservation/discarding works as expected - Tests - `thread_ui_test.js` - Test that `MessageManager.draft` is properly set if it didn't exist before saving a draft
Attachment #8359428 - Flags: review?(waldron.rick)
Attachment #8359428 - Flags: feedback?(felash)
Comment on attachment 8359428 [details] [review] https://github.com/mozilla-b2g/gaia/pull/15273 good for me too. 2 questions/comments for you (and for me ;) ) though * Can you please clarify what "preserve" means exactly ? * I would have added a "visibilitychange" handler in ThreadUI instead of using the one in MessageManager. Also, why calling Drafts.store() at the end even when we don't save drafts?
Attachment #8359428 - Flags: feedback?(felash) → feedback+
(In reply to Julien Wajsberg [:julienw] from comment #6) > Comment on attachment 8359428 [details] [review] > https://github.com/mozilla-b2g/gaia/pull/15273 > > good for me too. > > 2 questions/comments for you (and for me ;) ) though > * Can you please clarify what "preserve" means exactly ? Addressed in patch with a clearer comment. > * I would have added a "visibilitychange" handler in ThreadUI instead of > using the one in MessageManager. Also, why calling Drafts.store() at the end > even when we don't save drafts? Reported as a new bug: https://bugzilla.mozilla.org/show_bug.cgi?id=959696
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: