Closed
Bug 496485
Opened 15 years ago
Closed 14 years ago
make Service.wipeServer work properly
Categories
(Firefox :: Sync, defect)
Firefox
Sync
Tracking
()
RESOLVED
FIXED
1.3b1
People
(Reporter: Mardak, Assigned: mconnor)
Details
Attachments
(1 file, 2 obsolete files)
2.37 KB,
patch
|
Mardak
:
review+
|
Details | Diff | Splinter Review |
Each sync engine knows how to wipe itself from the server by deleting the engine directory and the crypto meta url. WeaveSvc_wipeServer manually deletes the engine directory by name instead of calling the engine's wipe server, and it doesn't delete the crypto/meta. So switch to SyngEngine's?
Comment 1•15 years ago
|
||
We should use the SyncEngine's wipe method, I agree.
Updated•15 years ago
|
Target Milestone: -- → 1.0
Assignee | ||
Updated•15 years ago
|
Component: Weave → General
Product: Mozilla Labs → Weave
Version: Trunk → unspecified
Updated•15 years ago
|
QA Contact: weave → general
Assignee | ||
Updated•14 years ago
|
Component: General → Sync
QA Contact: general → sync
Target Milestone: 1.0 → 1.2
Assignee | ||
Updated•14 years ago
|
Flags: blocking-weave1.3+
Target Milestone: 1.2 → 1.3
Assignee | ||
Comment 2•14 years ago
|
||
wipeServer works for engines, but doesn't work for other collections, including those that aren't implemented in the current client. So we should use engine.wipeServer if possible, and otherwise issue the deletes directly (and add the crypto URL to the manual deletes)
Reporter | ||
Comment 3•14 years ago
|
||
Comment on attachment 437718 [details] [diff] [review] use wipeServer if possible >+++ b/source/modules/service.js > // If we have a list of engines, make sure it's one we want > if (engines && engines.indexOf(name) == -1) > continue; >+ >+ let engine; >+ if (engine = Engines.get(name)) >+ engine.wipeServer(); Nothing special that requires the assignment to be done this way. Just assign when declaring engine and check for engine != null. It might be saner to just special case check for engines without getting infoURL and just looping over the array to grab the engine and wipeServer(). This means we might issue deletes for stuff that isn't there, but that's not too bad and makes sure the crypto record goes away. >+ else { >+ new Resource(this.storageURL + name).delete(); >+ new Resource(this.storageURL + "crypto/" + name).delete(); These things that aren't engines aren't engines, so they don't have an accompanying crypto record.
Attachment #437718 -
Flags: review?(edilee) → review-
Assignee | ||
Comment 4•14 years ago
|
||
(In reply to comment #3) > (From update of attachment 437718 [details] [diff] [review]) > >+++ b/source/modules/service.js > > // If we have a list of engines, make sure it's one we want > > if (engines && engines.indexOf(name) == -1) > > continue; > >+ > >+ let engine; > >+ if (engine = Engines.get(name)) > >+ engine.wipeServer(); > Nothing special that requires the assignment to be done this way. Just assign > when declaring engine and check for engine != null. Fixed. > It might be saner to just special case check for engines without getting > infoURL and just looping over the array to grab the engine and wipeServer(). > This means we might issue deletes for stuff that isn't there, but that's not > too bad and makes sure the crypto record goes away. Fixed, sort of. We'll only hit infoURL if we don't call this with an arg. > >+ else { > >+ new Resource(this.storageURL + name).delete(); > >+ new Resource(this.storageURL + "crypto/" + name).delete(); > These things that aren't engines aren't engines, so they don't have an > accompanying crypto record. There may be engines that aren't part of the current client, we should still clear their crypto records if they exist.
Assignee | ||
Comment 5•14 years ago
|
||
Attachment #437718 -
Attachment is obsolete: true
Attachment #437745 -
Flags: review?(edilee)
Assignee | ||
Updated•14 years ago
|
Whiteboard: [has patch][needs review Mardak]
Reporter | ||
Comment 6•14 years ago
|
||
Comment on attachment 437745 [details] [diff] [review] v2 >+ let engine = Engines.get(name); >+ if (engine) >+ engine.wipeServer(); >+ else { // delete manually >+ new Resource(this.storageURL + name).delete(); >+ new Resource(this.storageURL + "crypto/" + name).delete(); Still not sure what's the benefit of special casing engines here vs blindly deleting crypto/<collection>. Might as well just get rid of SyncEngine_wipeServer code. Could perhaps be slightly smarter to detect that the whole crypto collection is going to be deleted.
Assignee | ||
Comment 7•14 years ago
|
||
It was basically future-proofing against some engine doing something tricksy so they do extra stuff on wipe server. That said, I'm _entirely_ happy to nuke SyncEngine_wipeServer and just make people call this with the engine name as an arg, and removing it from the engine object!
Whiteboard: [has patch][needs review Mardak] → [needs new patch]
Assignee | ||
Updated•14 years ago
|
Attachment #437745 -
Attachment is obsolete: true
Attachment #437745 -
Flags: review?(edilee)
Assignee | ||
Comment 8•14 years ago
|
||
* just nuke storage and crypto for each collection. * remove engine_wipeServer, as it's unused
Attachment #437938 -
Flags: review?(edilee)
Reporter | ||
Updated•14 years ago
|
Attachment #437938 -
Flags: review?(edilee) → review+
Reporter | ||
Updated•14 years ago
|
Whiteboard: [needs new patch] → [has patch][has review]
Assignee | ||
Updated•14 years ago
|
Summary: Unused SyncEngine_wipeServer → make Service.wipeServer work properly
Assignee | ||
Comment 9•14 years ago
|
||
http://hg.mozilla.org/labs/weave/rev/56aa3c5e3724
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][has review]
Assignee | ||
Updated•14 years ago
|
Target Milestone: 1.3 → 1.3b1
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
•