Skip to content

Commit

Permalink
Removed obsolete iOS sync logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lougeniaC64 committed Jul 13, 2023
1 parent 47f4c50 commit a4aafc2
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 166 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# v117.0 (In progress)

## General

### 🦊 What's Changed 🦊

- Removed obsolete sync functions that were exposed for Firefox iOS prior to the sync manager component integration ([#5725](https://github.com/mozilla/application-services/pull/5725)).

## Nimbus SDK ⛅️🔬🔭

### ✨ What's New ✨
Expand Down
28 changes: 0 additions & 28 deletions components/logins/ios/Logins/LoginsStorage.swift
Expand Up @@ -21,21 +21,6 @@ open class LoginsStorage {
store = try LoginStore(path: databasePath)
}

/// Delete all locally stored login sync metadata. It's unclear if
/// there's ever a reason for users to call this
open func reset() throws {
try queue.sync {
try self.store.reset()
}
}

/// Delete all locally stored login data.
open func wipe() throws {
try queue.sync {
try self.store.wipe()
}
}

open func wipeLocal() throws {
try queue.sync {
try self.store.wipeLocal()
Expand Down Expand Up @@ -103,19 +88,6 @@ open class LoginsStorage {
self.store.registerWithSyncManager()
}
}

open func sync(unlockInfo: SyncUnlockInfo) throws -> String {
return try queue.sync {
try self.store
.sync(
keyId: unlockInfo.kid,
accessToken: unlockInfo.fxaAccessToken,
syncKey: unlockInfo.syncKey,
tokenserverUrl: unlockInfo.tokenserverURL,
localEncryptionKey: unlockInfo.loginEncryptionKey
)
}
}
}

public func migrateLoginsFromSqlcipher(
Expand Down
3 changes: 0 additions & 3 deletions components/logins/src/logins.udl
Expand Up @@ -158,7 +158,4 @@ interface LoginStore {

[Self=ByArc]
void register_with_sync_manager();

[Throws=LoginsApiError, Self=ByArc]
string sync(string key_id, string access_token, string sync_key, string tokenserver_url, string local_encryption_key);
};
106 changes: 0 additions & 106 deletions components/places/ios/Places/Places.swift
Expand Up @@ -70,105 +70,6 @@ public class PlacesAPI {
}
}

/**
* Sync the bookmarks collection.
*
* - Returns: A JSON string representing a telemetry ping for this sync. The
* string contains the ping payload, and should be sent to the
* telemetry submission endpoint.
*
* - Throws:
* - `PlacesApiError.databaseInterrupted`: If a call is made to `interrupt()` on this
* object from another thread.
* - `PlacesApiError.unexpected`: When an error that has not specifically been exposed
* to Swift is encountered (for example IO errors from
* the database code, etc).
* - `PlacesApiError.panic`: If the rust code panics while completing this
* operation. (If this occurs, please let us know).
*/
open func syncBookmarks(unlockInfo: SyncUnlockInfo) throws -> String {
return try queue.sync {
try self.api.bookmarksSync(
keyId: unlockInfo.kid,
accessToken: unlockInfo.fxaAccessToken,
syncKey: unlockInfo.syncKey,
tokenserverUrl: unlockInfo.tokenserverURL
)
}
}

/**
* Sync the History collection.
*
* - Returns: A JSON string representing a telemetry ping for this sync. The
* string contains the ping payload, and should be sent to the
* telemetry submission endpoint.
*
* - Throws:
* - `PlacesApiError.databaseInterrupted`: If a call is made to `interrupt()` on this
* object from another thread.
* - `PlacesApiError.unexpected`: When an error that has not specifically been exposed
* to Swift is encountered (for example IO errors from
* the database code, etc).
* - `PlacesApiError.panic`: If the rust code panics while completing this
* operation. (If this occurs, please let us know).
*/
open func syncHistory(unlockInfo: SyncUnlockInfo) throws -> String {
return try queue.sync {
try self.api.historySync(
keyId: unlockInfo.kid,
accessToken: unlockInfo.fxaAccessToken,
syncKey: unlockInfo.syncKey,
tokenserverUrl: unlockInfo.tokenserverURL
)
}
}

/**
* Resets all sync metadata for history, including change flags,
* sync statuses, and last sync time. The next sync after reset
* will behave the same way as a first sync when connecting a new
* device.
*
* This method only needs to be called when the user disconnects
* from Sync. There are other times when Places resets sync metadata,
* but those are handled internally in the Rust code.
*
* - Throws:
* - `PlacesApiError.databaseInterrupted`: If a call is made to `interrupt()` on this
* object from another thread.
* - `PlacesApiError.unexpected`: When an error that has not specifically been exposed
* to Swift is encountered (for example IO errors from
* the database code, etc).
* - `PlacesApiError.panic`: If the rust code panics while completing this
* operation. (If this occurs, please let us know).
*/
open func resetHistorySyncMetadata() throws {
return try queue.sync {
try self.api.resetHistory()
}
}

/**
* Resets all sync metadata for bookmarks, including change flags, sync statuses, and
* last sync time. The next sync after reset will behave the same way as a first sync
* when connecting a new device.
*
* - Throws:
* - `PlacesApiError.databaseInterrupted`: If a call is made to `interrupt()` on this
* object from another thread.
* - `PlacesApiError.unexpected`: When an error that has not specifically been exposed
* to Swift is encountered (for example IO errors from
* the database code, etc).
* - `PlacesApiError.panic`: If the rust code panics while completing this
* operation. (If this occurs, please let us know).
*/
open func resetBookmarkSyncMetadata() throws {
return try queue.sync {
try self.api.bookmarksReset()
}
}

open func registerWithSyncManager() {
queue.sync {
self.api.registerWithSyncManager()
Expand Down Expand Up @@ -877,13 +778,6 @@ public class PlacesWriteConnection: PlacesReadConnection {
}
}

open func wipeLocalHistory() throws {
try queue.sync {
try self.checkApi()
try self.conn.wipeLocalHistory()
}
}

open func deleteEverythingHistory() throws {
try queue.sync {
try self.checkApi()
Expand Down
23 changes: 0 additions & 23 deletions components/tabs/ios/Tabs/Tabs.swift
Expand Up @@ -26,32 +26,9 @@ open class TabsStorage {
}
}

open func reset() throws {
try queue.sync {
try self.store.reset()
}
}

open func registerWithSyncManager() {
queue.sync {
self.store.registerWithSyncManager()
}
}

open func sync(unlockInfo: SyncUnlockInfo) throws -> String {
guard let tabsLocalId = unlockInfo.tabsLocalId else {
throw TabsApiError.UnexpectedTabsError(reason: "tabs local ID was not provided")
}

return try queue.sync {
try self.store
.sync(
keyId: unlockInfo.kid,
accessToken: unlockInfo.fxaAccessToken,
syncKey: unlockInfo.syncKey,
tokenserverUrl: unlockInfo.tokenserverURL,
localId: tabsLocalId
)
}
}
}
6 changes: 0 additions & 6 deletions components/tabs/src/tabs.udl
Expand Up @@ -26,12 +26,6 @@ interface TabsStore {
[Self=ByArc]
void register_with_sync_manager();

[Throws=TabsApiError, Self=ByArc]
void reset();

[Throws=TabsApiError, Self=ByArc]
string sync(string key_id, string access_token, string sync_key, string tokenserver_url, string local_id);

[Self=ByArc]
TabsBridgedEngine bridged_engine();

Expand Down

0 comments on commit a4aafc2

Please sign in to comment.