mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-29 20:57:43 -10:00
As noted on the bug, because we call getMigratorKeyForDefaultBrowser() multiple times, its value no longer reflects the (deleted) registry key for subsequent calls. While we can fix this for the automigrate case by just passing the default we determined a few lines earlier (and that seems worth doing to avoid busywork), there are 2 small problems with this: 1) if the default browser has no data, `migratorKey` won't be set, and so we'll call the same method again anyway, and the message reported in the error console will be that we can't migrate from Firefox, when the real problem is that we can't migrate from the original default browser. 2) there are other callers besides AutoMigrate. Specifically, migration.js also calls this method. To deal with these, I've fixed getMigratorKeyForDefaultBrowser() to return the same registry-based value for its lifetime if we hit the 'the default is firefox, go look for an earlier default' case. I've verified that either the s/aMigratorKey/migratorKey/ or the change to getMigratorKeyForDefaultBrowser() are sufficient to make this work properly in the automigration case. While I was here, I also updated one of the error messages to be more explicit. MozReview-Commit-ID: GeUNTfScMMB