Closed
Bug 587027
Opened 14 years ago
Closed 14 years ago
Use as little memory as possible
Categories
(Firefox :: Sync, defect)
Firefox
Sync
Tracking
()
RESOLVED
FIXED
People
(Reporter: philikon, Assigned: philikon)
References
Details
Attachments
(5 files, 6 obsolete files)
2.93 KB,
patch
|
mconnor
:
review+
|
Details | Diff | Splinter Review |
34.62 KB,
patch
|
Details | Diff | Splinter Review | |
7.76 KB,
patch
|
Details | Diff | Splinter Review | |
4.20 KB,
patch
|
mconnor
:
review+
|
Details | Diff | Splinter Review |
6.93 KB,
patch
|
mconnor
:
review+
|
Details | Diff | Splinter Review |
Sync should do as little as possible on startup, especially when it's not configured: * Move the Weave object to a separate file (main.js) * Make properties lazy getters that import only when accessed (incl. service.js) * Move startup related status stuff (_checkSetup etc.) to status.js so service.js doesn't have to be imported if the client isn't configured.
Assignee | ||
Comment 1•14 years ago
|
||
Part 1: Move the Weave object out of service.js
Assignee: nobody → philipp
Attachment #465860 -
Flags: review?(mconnor)
Assignee | ||
Comment 2•14 years ago
|
||
Part 2: Fix tests after Weave relocation
Attachment #465861 -
Flags: review?(mconnor)
Assignee | ||
Comment 3•14 years ago
|
||
Part 3: Fix up add-on UI to import main.js to get the Weave object.
Attachment #465862 -
Flags: review?(mconnor)
Assignee | ||
Comment 4•14 years ago
|
||
Refactor Service._checkSetup() to Status.checkSetup(). Also move the test fixture for WeaveCryptoID to the individual tests that need it.
Attachment #465863 -
Flags: review?(mconnor)
Assignee | ||
Comment 5•14 years ago
|
||
Avoid accessing Weave.Service (=importing service.js) at all cost.
Attachment #465916 -
Flags: review?(mconnor)
Assignee | ||
Comment 6•14 years ago
|
||
Comment on attachment 465916 [details] [diff] [review] part5 v1 Clearing r? flag from WIP patch... muscle memory ;)
Attachment #465916 -
Flags: review?(mconnor)
Comment 7•14 years ago
|
||
Comment on attachment 465860 [details] [diff] [review] part1 v1 >+let Weave = {}; >+Components.utils.import("resource://services-sync/constants.js", Weave); >+lazyImport("resource://services-sync/auth.js", Weave, >+ ['Auth', 'BrokenBasicAuthenticator', 'BasicAuthenticator', >+ 'NoOpAuthenticator']); >+lazyImport("resource://services-sync/base_records/keys.js", Weave, >+ ['PubKey', 'PrivKey', 'PubKeys', 'PrivKeys']); >+lazyImport("resource://services-sync/engines.js", Weave, >+ ['Engines', 'Engine', 'SyncEngine']); ...etc for the sake of readability, can we do: let imports = { "auth.js": ['Auth', 'BrokenBasicAuthenticator', 'BasicAuthenticator', 'NoOpAuthenticator'], "base_records/keys.js": ['PubKey', 'PrivKey', 'PubKeys', 'PrivKeys'], etc }; for (let i in imports) lazyImport("resource://services-sync/" + i, Weave, imports[i]) Just makes it more explicitly mapping file -> symbols and removes a lot of text duplication r=me with that change
Attachment #465860 -
Flags: review?(mconnor) → review+
Updated•14 years ago
|
Attachment #465861 -
Flags: review?(mconnor) → review+
Updated•14 years ago
|
Attachment #465862 -
Flags: review?(mconnor) → review+
Updated•14 years ago
|
Attachment #465863 -
Flags: review?(mconnor) → review+
Assignee | ||
Comment 8•14 years ago
|
||
Addressed review comments.
Attachment #465860 -
Attachment is obsolete: true
Assignee | ||
Comment 9•14 years ago
|
||
Fix up new test that was committed in the mean time.
Attachment #465861 -
Attachment is obsolete: true
Assignee | ||
Comment 10•14 years ago
|
||
Fix bug in Weave.Status.checkSetup(): We need to create the Identity objects if they don't exist yet before being able to check the password.
Attachment #465863 -
Attachment is obsolete: true
Assignee | ||
Comment 11•14 years ago
|
||
Comment on attachment 465916 [details] [diff] [review] part5 v1 Turns out that part 5 (avoiding accessing Weave.Service in the UI code) was working, there was just a small bug in part 3 (Weave.Service.checkSetup()). Requesting r?
Attachment #465916 -
Attachment description: part5 WIP → part5 v1
Attachment #465916 -
Flags: review?(mconnor)
Assignee | ||
Comment 12•14 years ago
|
||
(In reply to comment #11) > bug in part 3 (Weave.Service.checkSetup()). Of course I meant part 4.
Assignee | ||
Comment 13•14 years ago
|
||
Don't explicitly access Weave.Service, wait for Weave.js to import service.js.
Attachment #465916 -
Attachment is obsolete: true
Attachment #468792 -
Flags: review?(mconnor)
Attachment #465916 -
Flags: review?(mconnor)
Assignee | ||
Comment 14•14 years ago
|
||
Also avoid accessing Weave.Service in Fennec UI and Weave.js when not necessary.
Attachment #468792 -
Attachment is obsolete: true
Attachment #469091 -
Flags: review?(mconnor)
Attachment #468792 -
Flags: review?(mconnor)
Assignee | ||
Comment 15•14 years ago
|
||
Continue to export the "Weave" object from service.js for backwards compatibility with the Firefox 4.0b4 UI.
Attachment #468294 -
Attachment is obsolete: true
Attachment #469110 -
Flags: review?(mconnor)
Updated•14 years ago
|
Attachment #469110 -
Flags: review?(mconnor) → review+
Comment 16•14 years ago
|
||
Comment on attachment 469091 [details] [diff] [review] part5 v3 >diff --git a/ui/fennec/content/overlay.js b/ui/fennec/content/overlay.js > // Generating keypairs is expensive on mobile, so disable it >- Weave.Service.keyGenEnabled = false; >+ if (Weave.Status.checkSetup() != Weave.CLIENT_NOT_CONFIGURED) >+ Weave.Service.keyGenEnabled = false; this feels like something we should have as a pref-based property, and not set it on every startup. Then we don't need this call here, and it's just a pref for fennec trunk.
Attachment #469091 -
Flags: review?(mconnor) → review+
Assignee | ||
Comment 17•14 years ago
|
||
(In reply to comment #16) > this feels like something we should have as a pref-based property, and not set > it on every startup. Then we don't need this call here, and it's just a pref > for fennec trunk. Filed follow-up bug 590743
Assignee | ||
Comment 18•14 years ago
|
||
http://hg.mozilla.org/services/fx-sync/pushloghtml?changeset=4ca292df057c part1: http://hg.mozilla.org/services/fx-sync/rev/eca588ee0c21 part2: http://hg.mozilla.org/services/fx-sync/rev/75f4d80c94d5 part3: http://hg.mozilla.org/services/fx-sync/rev/b9657bce354f part4: http://hg.mozilla.org/services/fx-sync/rev/422ce92d2192 part5: http://hg.mozilla.org/services/fx-sync/rev/4ca292df057c
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in
before you can comment on or make changes to this bug.
Description
•