This repository has been archived by the owner. It is now read-only.
Migrating tabs and bookmarks from Ghostery #28
Merged
Conversation
| self.delegate = migrationDelegate | ||
|
|
||
| let defaults = UserDefaults.standard | ||
| guard defaults.object(forKey: GhosteryMigrationManager.migrationKey) == nil && self.ghosteryDB != nil else { |
naira-cliqz
May 8, 2018
Contributor
Would be better to check for the migrationKey in init method, before opening the DB do not initialize the DB if it's already migrated. In startMigration it will start if the db is not nil.
Would be better to check for the migrationKey in init method, before opening the DB do not initialize the DB if it's already migrated. In startMigration it will start if the db is not nil.
| DispatchQueue.global().async { [weak self] in | ||
| self?.migrateOpenTabs() | ||
|
|
||
| let migrateFolders = self?.migrateBookmarkFolders() |
naira-cliqz
May 8, 2018
Contributor
Would be better to have another method for this chunk like migrateFoldersAndBookmarks and migrateBookmarkFolders this method can be just migrateFolders
Would be better to have another method for this chunk like migrateFoldersAndBookmarks and migrateBookmarkFolders this method can be just migrateFolders
| import Deferred | ||
|
|
||
| public protocol GhosteryMigrationDelegate: class { | ||
| func migrationOpenURLInNewTab(_ url: URL) |
naira-cliqz
May 8, 2018
Contributor
the method name could be more generic, like ghosteryTabMigrated
the method name could be more generic, like ghosteryTabMigrated
| } | ||
| } | ||
|
|
||
| private func migrateBookmarkFolders() -> Deferred<Maybe<Cursor<BookmarkMirrorItem>>> { |
naira-cliqz
May 8, 2018
Contributor
Actually this method doesn't migrate the data, it only fetches the data
Actually this method doesn't migrate the data, it only fetches the data
| } | ||
|
|
||
| private func migrateOpenTabs() { | ||
| let sql = "SELECT * from \(TableGhosteryTabs)" |
naira-cliqz
May 8, 2018
Contributor
why query isn't ordered by instead of sorting afterwards?
why query isn't ordered by instead of sorting afterwards?
980fc81
to
55eb65c
55eb65c
to
08c6290
f0c3411
into
ghostery:master
1 check was pending
1 check was pending
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
No description provided.