@@ -170,7 +170,7 @@ class MigrationService @Inject constructor(
170170 pendingBlocktankOrderIds = json.decodeFromString<List <String >>(data)
171171 Logger .debug(" Loaded ${pendingBlocktankOrderIds?.size} pending Blocktank order IDs" , context = TAG )
172172 }.onFailure {
173- Logger .warn(" Failed to load pending Blocktank order IDs: $it " , context = TAG )
173+ Logger .warn(" Failed to load pending Blocktank order IDs" , it , context = TAG )
174174 }
175175 }
176176
@@ -179,7 +179,7 @@ class MigrationService @Inject constructor(
179179 pendingRemotePaidOrders = json.decodeFromString<Map <String , String >>(data)
180180 Logger .debug(" Loaded ${pendingRemotePaidOrders?.size} pending paid orders" , context = TAG )
181181 }.onFailure {
182- Logger .warn(" Failed to load pending paid orders: $it " , context = TAG )
182+ Logger .warn(" Failed to load pending paid orders" , it , context = TAG )
183183 }
184184 }
185185
@@ -188,7 +188,7 @@ class MigrationService @Inject constructor(
188188 pendingRemoteMetadata = json.decodeFromString<RNMetadata >(data)
189189 Logger .debug(" Loaded pending metadata (tags: ${pendingRemoteMetadata?.tags?.size} )" , context = TAG )
190190 }.onFailure {
191- Logger .warn(" Failed to load pending metadata: $it " , context = TAG )
191+ Logger .warn(" Failed to load pending metadata" , it , context = TAG )
192192 }
193193 }
194194
@@ -197,7 +197,7 @@ class MigrationService @Inject constructor(
197197 pendingRemoteTransfers = json.decodeFromString<Map <String , String >>(data)
198198 Logger .debug(" Loaded ${pendingRemoteTransfers?.size} pending transfers" , context = TAG )
199199 }.onFailure {
200- Logger .warn(" Failed to load pending transfers: $it " , context = TAG )
200+ Logger .warn(" Failed to load pending transfers" , it , context = TAG )
201201 }
202202 }
203203
@@ -206,7 +206,7 @@ class MigrationService @Inject constructor(
206206 pendingRemoteBoosts = json.decodeFromString<Map <String , String >>(data)
207207 Logger .debug(" Loaded ${pendingRemoteBoosts?.size} pending boosts" , context = TAG )
208208 }.onFailure {
209- Logger .warn(" Failed to load pending boosts: $it " , context = TAG )
209+ Logger .warn(" Failed to load pending boosts" , it , context = TAG )
210210 }
211211 }
212212 }
@@ -265,6 +265,30 @@ class MigrationService @Inject constructor(
265265 Logger .debug(" Cleared persisted Blocktank data" , context = TAG )
266266 }
267267
268+ private suspend fun clearPersistedTransfers () {
269+ rnMigrationStore.edit {
270+ it.remove(stringPreferencesKey(RN_PENDING_TRANSFERS_KEY ))
271+ }
272+ pendingRemoteTransfers = null
273+ Logger .debug(" Cleared persisted transfers" , context = TAG )
274+ }
275+
276+ private suspend fun clearPersistedBoosts () {
277+ rnMigrationStore.edit {
278+ it.remove(stringPreferencesKey(RN_PENDING_BOOSTS_KEY ))
279+ }
280+ pendingRemoteBoosts = null
281+ Logger .debug(" Cleared persisted boosts" , context = TAG )
282+ }
283+
284+ private suspend fun clearPersistedMetadata () {
285+ rnMigrationStore.edit {
286+ it.remove(stringPreferencesKey(RN_PENDING_METADATA_KEY ))
287+ }
288+ pendingRemoteMetadata = null
289+ Logger .debug(" Cleared persisted metadata" , context = TAG )
290+ }
291+
268292 private suspend fun clearPersistedMigrationData () {
269293 rnMigrationStore.edit {
270294 it.remove(stringPreferencesKey(RN_PENDING_BLOCKTANK_ORDER_IDS_KEY ))
@@ -1167,7 +1191,7 @@ class MigrationService @Inject constructor(
11671191 }
11681192 }
11691193 }.onFailure { e ->
1170- Logger .warn(" Failed to fetch and upsert local Blocktank orders: $e " , context = TAG )
1194+ Logger .warn(" Failed to fetch and upsert local Blocktank orders" , e , context = TAG )
11711195 persistBlocktankOrderIds(orderIds)
11721196 if (paidOrders.isNotEmpty()) {
11731197 persistPaidOrders(paidOrders)
@@ -1313,7 +1337,7 @@ class MigrationService @Inject constructor(
13131337 pendingRemoteActivityData = items
13141338 applyRNActivities(items)
13151339 }.onFailure { e ->
1316- Logger .warn(" Failed to decode RN remote activity backup: $e " , context = TAG )
1340+ Logger .warn(" Failed to decode RN remote activity backup" , e , context = TAG )
13171341 }
13181342 }
13191343
@@ -1322,7 +1346,7 @@ class MigrationService @Inject constructor(
13221346 val metadata = decodeBackupData<RNMetadata >(data)
13231347 persistMetadata(metadata)
13241348 }.onFailure { e ->
1325- Logger .warn(" Failed to decode RN remote metadata backup: $e " , context = TAG )
1349+ Logger .warn(" Failed to decode RN remote metadata backup" , e , context = TAG )
13261350 }
13271351 }
13281352
@@ -1461,20 +1485,20 @@ class MigrationService @Inject constructor(
14611485 pendingRemoteTransfers?.let { transfers ->
14621486 Logger .info(" Applying ${transfers.size} remote transfer markers" , context = TAG )
14631487 applyRemoteTransfers(transfers)
1464- pendingRemoteTransfers = null
1488+ clearPersistedTransfers()
14651489 }
14661490
14671491 pendingRemoteBoosts?.let { boosts ->
14681492 Logger .info(" Applying ${boosts.size} remote boost markers" , context = TAG )
14691493 applyBoostTransactions(boosts)
1470- pendingRemoteBoosts = null
1494+ clearPersistedBoosts()
14711495 }
14721496
14731497 // Apply remote metadata (tags) AFTER activities are created
14741498 pendingRemoteMetadata?.let { metadata ->
14751499 Logger .info(" Applying remote metadata (tags: ${metadata.tags?.size} )" , context = TAG )
14761500 applyRNMetadata(metadata)
1477- pendingRemoteMetadata = null
1501+ clearPersistedMetadata()
14781502 }
14791503
14801504 var blocktankFetchFailed = false
@@ -1502,7 +1526,7 @@ class MigrationService @Inject constructor(
15021526 pendingRemotePaidOrders = null
15031527 clearPersistedBlocktankData()
15041528 }.onFailure { e ->
1505- Logger .warn(" Still unable to fetch Blocktank orders: $e " , context = TAG )
1529+ Logger .warn(" Still unable to fetch Blocktank orders" , e , context = TAG )
15061530 blocktankFetchFailed = true
15071531 }
15081532 }
0 commit comments