Closed Bug 1253439 Opened 8 years ago Closed 8 years ago

FOREIGN KEY constraint failed when un-syncing bookmarks when not fully merged

Categories

(Firefox for iOS :: Sync, defect)

All
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios-v3.0 --- fixed
fxios-v4.0 --- fixed

People

(Reporter: rnewman, Assigned: rnewman)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

48 bytes, text/x-github-pull-request
nalexander
: review+
Details | Review
Sync partially rooted bookmarks. Uncheck bookmarks on desktop. Sync. Sync device.

Resetting fails:

2016-03-03 14:54:36.141 [Debug] [Downloader.swift:56] resetDownloaderWithPrefs(_:collection:) > Resetting downloader prefs profile.sync.synchronizer.history..downloader.history... Previous values: Optional(1457045078280), Optional(1456868212789).
2016-03-03 14:54:36.150 [Warning] [BrowserDB.swift:410] run > SQL operation failed: Abort due to constraint violation FOREIGN KEY constraint failed
2016-03-03 14:54:36.150 [Debug] [SwiftData.swift:165] transaction(synchronous:transactionClosure:) > Op in transaction failed. Rolling back.
2016-03-03 14:54:36.169 [Debug] [Downloader.swift:56] resetDownloaderWithPrefs(_:collection:) > Resetting downloader prefs profile.sync.synchronizer.bookmarks..downloader.bookmarks... Previous values: Optional(1456280063000), Optional(1456280062999).
Perhaps something bad with my test profile's data; a full merge fails at the end with

2016-03-03 14:57:18.373 [Debug] [SQLiteBookmarksSyncing.swift:344] deleteStructureForGUIDs(_:fromTable:connection:withMaxVars:) > Deleting 84 parents from bookmarksMirrorStructure.
2016-03-03 14:57:18.383 [Debug] [SQLiteBookmarksSyncing.swift:372] insertStructureIntoTable(_:connection:children:maxVars:) > Inserting 333 records (out of 1727).
2016-03-03 14:57:18.388 [Debug] [SQLiteBookmarksSyncing.swift:372] insertStructureIntoTable(_:connection:children:maxVars:) > Inserting 333 records (out of 1727).
2016-03-03 14:57:18.394 [Debug] [SQLiteBookmarksSyncing.swift:372] insertStructureIntoTable(_:connection:children:maxVars:) > Inserting 333 records (out of 1727).
2016-03-03 14:57:18.402 [Debug] [SQLiteBookmarksSyncing.swift:372] insertStructureIntoTable(_:connection:children:maxVars:) > Inserting 333 records (out of 1727).
2016-03-03 14:57:18.408 [Debug] [SQLiteBookmarksSyncing.swift:372] insertStructureIntoTable(_:connection:children:maxVars:) > Inserting 333 records (out of 1727).
2016-03-03 14:57:18.414 [Debug] [SQLiteBookmarksSyncing.swift:372] insertStructureIntoTable(_:connection:children:maxVars:) > Inserting 62 records (out of 1727).
2016-03-03 14:57:18.418 [Error] [SwiftData.swift:160] transaction(synchronous:transactionClosure:) > COMMIT failed. Rolling back.
2016-03-03 14:57:18.418 [Warning] [SQLiteBookmarksSyncing.swift:1088] applyLocalOverrideCompletionOp(_:itemSources:) > Got error “Abort due to constraint violation FOREIGN KEY constraint failed”
Attached file Pull req.
The array form of db.run runs all queries in a single transaction. That fixes the first issue.

I also tested the mirror->local flattening, and found some oddities. The second commit should prevent those from occurring.
Attachment #8726473 - Flags: review?(nalexander)
Attachment #8726473 - Flags: review?(bnicholson)
Comment on attachment 8726473 [details] [review]
Pull req.

lgtm.  It's *eventually* consistent, I'm sure :)
Attachment #8726473 - Flags: review?(nalexander) → review+
8ac1d04
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [needsuplift]
Target Milestone: --- → 4.0
Attachment #8726473 - Flags: review?(bnicholson)
v3.x ba1fad1
Whiteboard: [needsuplift]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: