[Messages][Drafts] Draft is neither removed nor updated if it was discarded or modified from another app instance (in Inbox only, until next restart)

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
4 years ago
2 years ago

People

(Reporter: azasypkin, Unassigned, Mentored)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sms-papercuts][sms-most-wanted][lang=js])

*** Follow-up from bug 1058459 ***

In patch for bug 1058459 we don't cover the following case:

1. Open Messages app (Instance #1) from HomeScreen;
2. Open Contacts app from HomeScreen;
3. In Contacts go to contact details of any contact (with number) and choose "Send message" option;
4. Once Messages app appeared (Instance #2), press Home button (draft should be automatically saved);
5. Activate Instance #1 from HomeScreen->Messages or Task Manager->Messages and observe that newly created draft is in the list;
6. Go back to Instance #2 via HomeScreen->Contacts or Task Manager->Contacts and tap on "X" to close activity and select "Discard draft" option;
7. Activate Instance #1 once again and observe thread list.

Expected result: discarded draft should be removed;

Actual result: draft is still in the thread list.

Though it's unclear what to do in case user opens that draft in the Instance #1, so that the same draft is opened by two Messages app instances at the same time.
Whiteboard: [sms-papercuts]
(Reporter)

Updated

4 years ago
Duplicate of this bug: 1152715
(Reporter)

Updated

4 years ago
Blocks: 1159247

Updated

3 years ago
Blocks: 1176976

Updated

3 years ago
No longer blocks: 1176976
(Reporter)

Comment 2

3 years ago
Updating title to stress that we want to fix both discard and modification cases. Modification case will become more visible after patch for bug 1176976 since now we always create a draft to support activity instance and don't remove draft in ConversationView.handleDraft.
Summary: [Messages][Drafts] Draft isn't removed (from UI only) if it was discarded from activity → [Messages][Drafts] Draft is neither removed nor updated if it was discarded or modified from another app instance (in Inbox only, until next restart)
(Reporter)

Updated

3 years ago
Depends on: 1176976
(Reporter)

Comment 3

3 years ago
This issue became more apparent after bug 1144132, so now in the main app instance we'll always see draft that's saved when user adds attachment in activity instance even after message is sent (that automatically discards draft for just sent message).

Likely can be fixed by making Drafts smarter in analyzing "drafts-changed" event from InterInstanceEventDispatcher [1], so that Drafts can emit "saved"/"deleted" event for every change it finds while comparing old and new drafts stores instead of running "renderDrafts" all the time [2].

It can be a mentored bug, though it's _not_ a good first one and requires prior experience in Firefox OS. This bug also has a good follow-up bug 1140339 (once bug 1140344 is finally resolved).

[1] https://github.com/mozilla-b2g/gaia/blob/362b0df924eba57c9abb7f9454fdf685accba4d6/apps/sms/services/js/drafts.js#L177

[2] https://github.com/mozilla-b2g/gaia/blob/362b0df924eba57c9abb7f9454fdf685accba4d6/apps/sms/views/inbox/js/inbox.js#L119
Mentor: azasypkin
Whiteboard: [sms-papercuts] → [sms-papercuts][sms-most-wanted][lang=js]
Comment hidden (typo)
Please note that after Bug 1217075 landed, the drafts-change event dispatch from another instance will become draft-saved/draft-deleted with target draft. Now we can update the draft directly once we get draft save/deleted event. A small reminder that we will need to add Drafts.init in conversation startup for interInstance event handling in split view mode.
Mass closing of Gaia::SMS bugs. End of an era :(
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
Mass closing of Gaia::SMS bugs. End of an era :(
You need to log in before you can comment on or make changes to this bug.