Closed
Bug 1384771
Opened 8 years ago
Closed 8 years ago
bufferParentidMatchesStructure consumer is too optimistic about parentid
Categories
(Firefox for iOS :: Sync, enhancement)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
fxios | 8.1+ | --- |
People
(Reporter: rnewman, Assigned: rnewman)
References
Details
Attachments
(1 file)
Our fourth validation step looks like this:
private let bufferParentidMatchesStructure = [
"SELECT b.guid, b.parentid, s.parent, s.child, s.idx FROM",
TableBookmarksBuffer, "b JOIN", TableBookmarksBufferStructure,
"s ON b.guid = s.child WHERE b.parentid IS NOT s.parent",
].joined(separator: " ")
which is a query like this:
SELECT b.guid, b.parentid, s.parent, s.child, s.idx FROM
buffer b JOIN structure s
ON b.guid = s.child WHERE b.parentid IS NOT s.parent;
Given a record that's marked as deleted -- null parentid -- but a non-updated parent record, this will yield NULL for the parentid.
This is OK. However, we then go on to try to turn the validation results into strings so we can report them:
private func getConcernedIDs(colNames: [String]) -> ((SDRow) -> [String]) {
return { (row: SDRow) in
colNames.map({ row[$0] as! String})
}
}
Two potential fixes here:
- Drop null IDs -- use `flatMap` and `as? String`. We should do this to fix the crash.
- Split this validation in two: one query that looks for rows in the buffer that are deleted, but still mentioned in structure; another that looks for non-deleted buffer rows that disagree. We should do this if we want to spot dropped deletions.
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8890619 -
Flags: review?
Updated•8 years ago
|
tracking-fxios:
--- → 8.1+
Comment 2•8 years ago
|
||
Comment on attachment 8890619 [details] [review]
Band-aid.
Looks good, let's ship it.
Attachment #8890619 -
Flags: review? → review+
Comment 3•8 years ago
|
||
Landed on master, uplifted to v8.x.
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Assignee: nobody → rnewman
Comment 6•8 years ago
|
||
¡Hola Richard!
Ended up here after asking on #sync while trying to help a user with a question in the SuMo forum at https://support.mozilla.org/es/questions/1168700
When would this reach end users?
¡Gracias!
Alex
Flags: needinfo?(rnewman)
Assignee | ||
Comment 7•8 years ago
|
||
It should have shipped as part of 8.1, which is already in the App Store as of a few days ago.
Flags: needinfo?(rnewman)
You need to log in
before you can comment on or make changes to this bug.
Description
•