Closed Bug 850904 Opened 12 years ago Closed 12 years ago

[email] deleting an account may break if an outstanding synchronization completes after the account is deleted

Categories

(Firefox OS Graveyard :: Gaia::E-Mail, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-b2g:tef+, b2g18 verified, b2g18-v1.0.1 verified)

VERIFIED FIXED
blocking-b2g tef+
Tracking Status
b2g18 --- verified
b2g18-v1.0.1 --- verified

People

(Reporter: asuth, Assigned: squib)

References

Details

Earlier today, Julien reported the following: "remove your last account, kill the app, restart the app => can't add an account" "I get "[JavaScript Error: "TypeError: accounts[i] is undefined" {file: "app://email.gaiamobile.org/js/ext/mailapi/maildb.js" line: 298}]"" The deal is that account deletion works correctly, but there are no guards to stop MailDB.saveAccountFolderStates() from being used on a dead account in MailDB or in the accounts themselves. We probably either want to add a bolean to shutdown() on the accounts that says if the account is being deleted, or add an explicit youAreDeleted() method or something. The key goal is for this to cause saveAccountState() to become a NOP. I do *not* believe that we would want shutdown() in the normal course of things to prevent saveAccountState. At least in the case of IMAP, we attempt to shutdown the connection, which should kill existing syncs, but we still want those syncs to have the opportunity to persist their state.
blocking-b2g: --- → tef?
As soon as this bug happens, basically the email app is unusable and the user needs to wipe its database to recover. That's why I nominate for tef?.
(tef+ due to the need for the end user to factory reset the device to recover)
blocking-b2g: tef? → tef+
I should be able to take a look at this next week.
Assignee: nobody → squibblyflabbetydoo
Status: NEW → ASSIGNED
I have a patch for this, and I'm just finishing up fixing the IMAP unit tests.
Hi Jim, what's the ETA for this one?
(In reply to Dietrich Ayala (:dietrich) from comment #5) > Hi Jim, what's the ETA for this one? Later this evening. I just need to press the big green merge button.
Update: I'm now waiting on some other stuff that's landed on GELAM but not Gaia so that I don't make uplifting harder for people.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
I was not able to uplift this bug to v1-train and v1.0.1. If this bug has dependencies which are not marked in this bug, please comment on this bug. If this bug depends on patches that aren't approved for v1-train and v1.0.1, we need to re-evaluate the approval. Otherwise, if this is just a merge conflict, you might be able to resolve it with: git checkout v1-train git cherry-pick -x -m1 fcef8d991beacf2a63c49b8fbc5e4ae3d660d226 <RESOLVE MERGE CONFLICTS> git commit git checkout v1.0.1 git cherry-pick -x $(git log -n1 v1-train)
Copying my comment from bug 853659 #6, since it's the same issue: > I have no idea what happened here. It looks like > apps/email/js/ext/mailapi/composer.js was removed in bug 851124, but that > was just an uplift bug, and I don't think that file was ever removed on > master (it's still there now, and none of the commits seem to have > temporarily deleted it).
Wait... I figured it out. These bugs are dependent on bug 852710, which hasn't been uplifted yet.
Depends on: 852710
Uplifted commit fcef8d991beacf2a63c49b8fbc5e4ae3d660d226 as: v1-train: bdb213199d1b81882ec5994185a318e6b46b321b v1.0.1: 2d88a921359b8eda0be9f712ec33ae919e9176d2
I tired to delete the email acct set up and delete it. The description says "remove your last account, kill the app, restart the app => can't add an account". Last account on the list of email accounts or the last account created? "Can you please provide steps to verify this fix - as we will blackbox test from the UI?"
By "last", comment 0 means "the last one remaining". In other words: 0) Start with a fresh profile 1) Create a mail account 2) Let it start syncing a big folder 3) Delete the account before syncing finishes 4) Kill the app 5) Reopen the app 6) Try to create a new account
This issue no longer reproduces on Unagi device Build ID: 20130402070202 Kernel Date: Dec 5 Gecko: http://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/ccec751a468e Gaia: ee0bef61c0a25c806dd1eec5a4e047bc418a5f73 also, issue appears fixed on build 20130402070204 Kernel Date: Dec 5 Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/68c8a883cfc0 Gaia: 1c38c91bb16f2bf0d5066c4787d2249463f61bb3 User is able to create a new email account, after deleting all of the previosly added email accounts
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.