Skip to content

Commit 9fcc934

Browse files
authored
Migration v5 (#984)
* version bump * fix naming * create migration v5 * delete old migration flag
1 parent 1a1bd52 commit 9fcc934

File tree

5 files changed

+30
-31
lines changed

5 files changed

+30
-31
lines changed

ios/Rainbow.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@
664664
"$(PROJECT_DIR)",
665665
);
666666
LLVM_LTO = YES;
667-
MARKETING_VERSION = 1.2.26;
667+
MARKETING_VERSION = 1.2.27;
668668
OTHER_CFLAGS = (
669669
"$(inherited)",
670670
"-DFB_SONARKIT_ENABLED=1",
@@ -723,7 +723,7 @@
723723
"$(PROJECT_DIR)",
724724
);
725725
LLVM_LTO = YES;
726-
MARKETING_VERSION = 1.2.26;
726+
MARKETING_VERSION = 1.2.27;
727727
OTHER_CFLAGS = (
728728
"$(inherited)",
729729
"-DFB_SONARKIT_ENABLED=1",
@@ -818,7 +818,7 @@
818818
"$(PROJECT_DIR)",
819819
);
820820
LLVM_LTO = YES;
821-
MARKETING_VERSION = 1.2.26;
821+
MARKETING_VERSION = 1.2.27;
822822
OTHER_CFLAGS = (
823823
"$(inherited)",
824824
"-DFB_SONARKIT_ENABLED=1",
@@ -914,7 +914,7 @@
914914
"$(PROJECT_DIR)",
915915
);
916916
LLVM_LTO = YES;
917-
MARKETING_VERSION = 1.2.26;
917+
MARKETING_VERSION = 1.2.27;
918918
OTHER_CFLAGS = (
919919
"$(inherited)",
920920
"-DFB_SONARKIT_ENABLED=1",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Rainbow",
3-
"version": "1.2.26-1",
3+
"version": "1.2.27-1",
44
"private": true,
55
"scripts": {
66
"android": "react-native run-android",

src/model/migrations.js

+17-5
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,27 @@ export default async function runMigrations() {
167167

168168
/*
169169
*************** Migration v4 ******************
170+
* Not in use
171+
*/
172+
173+
const v4 = async () => {
174+
logger.sentry('Ignoring migration v4');
175+
return true;
176+
};
177+
178+
migrations.push(v4);
179+
180+
/*
181+
*************** Migration v5 ******************
170182
* This step makes sure there are no wallets marked as damaged
171183
* incorrectly by the keychain integrity checks
172184
*/
173-
const v4 = async () => {
174-
logger.sentry('Start migration v4');
185+
const v5 = async () => {
186+
logger.sentry('Start migration v5');
175187
const { wallets, selected } = store.getState().wallets;
176188

177189
if (!wallets) {
178-
logger.sentry('Complete migration v4 early');
190+
logger.sentry('Complete migration v5 early');
179191
return;
180192
}
181193

@@ -211,10 +223,10 @@ export default async function runMigrations() {
211223
}
212224
}
213225
}
214-
logger.sentry('Complete migration v4');
226+
logger.sentry('Complete migration v5');
215227
};
216228

217-
migrations.push(v4);
229+
migrations.push(v5);
218230

219231
logger.sentry(
220232
`Migrations: ready to run migrations starting on number ${currentVersion}`

src/model/wallet.js

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export const addressKey = 'rainbowAddressKey';
3434
export const selectedWalletKey = 'rainbowSelectedWalletKey';
3535
export const allWalletsKey = 'rainbowAllWalletsKey';
3636
export const oldSeedPhraseMigratedKey = 'rainbowOldSeedPhraseMigratedKey';
37-
export const seedPhraseMigratedKey = 'rainbowSeedPhraseMigratedKey'; // NOT USED ANYMORE!
3837

3938
const privateKeyVersion = 1.0;
4039
const seedPhraseVersion = 1.0;

src/redux/wallets.js

+8-20
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
saveAddress,
1919
saveAllWallets,
2020
seedPhraseKey,
21-
seedPhraseMigratedKey,
2221
setSelectedWallet,
2322
} from '../model/wallet';
2423
import { settingsUpdateAccountAddress } from '../redux/settings';
@@ -199,32 +198,21 @@ export const checkKeychainIntegrity = () => async (dispatch, getState) => {
199198
);
200199
}
201200

202-
const hasMigratedFlag = await hasKey(seedPhraseMigratedKey);
203-
if (hasMigratedFlag) {
204-
logger.sentry(
205-
'[KeychainIntegrityCheck]: previous migrated flag is OK [NO LONGER RELEVANT]'
206-
);
207-
} else {
208-
logger.sentry(
209-
`[KeychainIntegrityCheck]: migrated flag is present: ${hasMigratedFlag} [NO LONGER RELEVANT]`
210-
);
211-
}
212-
213-
const hasOldSeedPhraseMigratedKey = await hasKey(oldSeedPhraseMigratedKey);
214-
if (hasOldSeedPhraseMigratedKey) {
201+
const hasOldSeedPhraseMigratedFlag = await hasKey(oldSeedPhraseMigratedKey);
202+
if (hasOldSeedPhraseMigratedFlag) {
215203
logger.sentry('[KeychainIntegrityCheck]: migrated flag is OK');
216204
} else {
217205
logger.sentry(
218-
`[KeychainIntegrityCheck]: migrated flag is present: ${hasOldSeedPhraseMigratedKey}`
206+
`[KeychainIntegrityCheck]: migrated flag is present: ${hasOldSeedPhraseMigratedFlag}`
219207
);
220208
}
221209

222-
const hasOldSeedphraseKey = await hasKey(seedPhraseKey);
223-
if (hasOldSeedphraseKey) {
210+
const hasOldSeedphrase = await hasKey(seedPhraseKey);
211+
if (hasOldSeedphrase) {
224212
logger.sentry('[KeychainIntegrityCheck]: old seed is still present!');
225213
} else {
226214
logger.sentry(
227-
`[KeychainIntegrityCheck]: old seed is present: ${hasOldSeedphraseKey}`
215+
`[KeychainIntegrityCheck]: old seed is present: ${hasOldSeedphrase}`
228216
);
229217
}
230218

@@ -281,8 +269,8 @@ export const checkKeychainIntegrity = () => async (dispatch, getState) => {
281269
// - and the old seedphrase is still there
282270
if (
283271
!wallet.imported &&
284-
!oldSeedPhraseMigratedKey &&
285-
hasOldSeedphraseKey
272+
!hasOldSeedPhraseMigratedFlag &&
273+
hasOldSeedphrase
286274
) {
287275
healthyWallet = true;
288276
}

0 commit comments

Comments
 (0)