-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hotfix: Migrate remaining chrysalis profiles (#7555)
* fix: error WIP * fix: Attempt * fix: Attempt 2 * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * fix: Fixes * clean up * fmt and lint * clean up * clean up * clean up * tweak * fix: corrupted profiles * fix: persistedProfileMigrationToV11 * feat: Fixed `no chrysalis data to migrate` (#7565) * fix: Fixed 'migration failed no chrysalis data to migrate' * update comment * tweak * feat: add missing onSuccess * fix: success condition --------- Co-authored-by: Begoña Alvarez <[email protected]> * feat: rename old profile folder names from name to id * fix: add full profile path --------- Co-authored-by: cpl121 <[email protected]> Co-authored-by: Begoña Alvarez <[email protected]>
- Loading branch information
1 parent
194ee93
commit a150caf
Showing
10 changed files
with
112 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,24 +140,24 @@ jobs: | |
if: matrix.os == 'ubuntu-20.04' | ||
|
||
- name: Sign AppImage (Linux) | ||
run: echo $GPG_PASSPHRASE | gpg --pinentry-mode loopback --batch --passphrase-fd 0 --armor --detach-sign --default-key [email protected] firefly-desktop*.AppImage | ||
run: echo $GPG_PASSPHRASE | gpg --pinentry-mode loopback --batch --passphrase-fd 0 --armor --detach-sign --default-key [email protected] firefly-*.AppImage | ||
working-directory: packages/desktop/out | ||
env: | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
if: matrix.os == 'ubuntu-20.04' | ||
|
||
- name: Compute checksums (Linux) | ||
run: for i in `ls | grep 'firefly-desktop*'` ; do sha256sum $i | awk {'print $1'} > $i.sha256 ; done | ||
run: for i in `ls | grep 'firefly-*'` ; do sha256sum $i | awk {'print $1'} > $i.sha256 ; done | ||
working-directory: packages/desktop/out | ||
if: matrix.os == 'ubuntu-20.04' | ||
|
||
- name: Compute checksums (macOS) | ||
run: for i in `ls | grep 'firefly-desktop*'` ; do shasum -a 256 $i | awk {'print $1'} > $i.sha256 ; done | ||
run: for i in `ls | grep 'firefly-*'` ; do shasum -a 256 $i | awk {'print $1'} > $i.sha256 ; done | ||
working-directory: packages/desktop/out | ||
if: matrix.os == 'macos-11' | ||
|
||
- name: Compute checksums (Windows) | ||
run: Get-ChildItem "." -Filter firefly-desktop* | Foreach-Object { $(Get-FileHash -Path $_.FullName -Algorithm SHA256).Hash | Set-Content ($_.FullName + '.sha256') } | ||
run: Get-ChildItem "." -Filter firefly-* | Foreach-Object { $(Get-FileHash -Path $_.FullName -Algorithm SHA256).Hash | Set-Content ($_.FullName + '.sha256') } | ||
working-directory: packages/desktop/out | ||
if: matrix.os == 'windows-2019' | ||
|
||
|
@@ -166,5 +166,5 @@ jobs: | |
with: | ||
name: firefly-desktop-${{ matrix.os }} | ||
path: | | ||
packages/desktop/out/firefly-desktop* | ||
packages/desktop/out/shimmer* | ||
packages/desktop/out/firefly-* | ||
packages/desktop/out/latest* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/shared/lib/core/profile/actions/profiles/renameOldProfileFoldersToId.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Platform } from '@core/app' | ||
import { profiles } from '@core/profile/stores' | ||
import { getStorageDirectoryOfProfile, getStorageDirectoryOfProfiles } from '@core/profile/utils' | ||
import { get } from 'svelte/store' | ||
|
||
export async function renameOldProfileFoldersToId(): Promise<void> { | ||
const walletPath = await getStorageDirectoryOfProfiles() | ||
const profileFolders = await Platform.listProfileFolders(walletPath) | ||
const oldProfiles = get(profiles).filter((profile) => | ||
profileFolders.find((p) => p === profile.name && profile.name !== profile.id) | ||
) | ||
if (oldProfiles.length > 0) { | ||
await Promise.all( | ||
oldProfiles.map(async (profile) => { | ||
await renameProfileFolder(profile.name, profile.id) | ||
}) | ||
) | ||
} | ||
} | ||
|
||
async function renameProfileFolder(oldName: string, newName: string): Promise<void> { | ||
const oldPath = await getStorageDirectoryOfProfile(oldName) | ||
const newPath = await getStorageDirectoryOfProfile(newName) | ||
await Platform.renameProfileFolder(oldPath, newPath) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/shared/lib/core/profile/stores/current-profile-version.store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { persistent } from '@core/utils/store' | ||
|
||
export const currentProfileVersion = persistent<number>('currentProfileVersion', -1) | ||
export const currentProfileVersion = persistent<number>('currentProfileVersion', 13) |