From 1e2491c3b3233af4e81fd89f0e2152299dfd2f7d Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 13 Dec 2023 15:53:37 +0100 Subject: [PATCH] Improve profile ID migration errors and run migration again --- profile/migrations.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/profile/migrations.go b/profile/migrations.go index eca9d8df..cbc16527 100644 --- a/profile/migrations.go +++ b/profile/migrations.go @@ -11,6 +11,7 @@ import ( "github.com/safing/portbase/database/migration" "github.com/safing/portbase/database/query" "github.com/safing/portbase/log" + "github.com/safing/portmaster/profile/icons" ) func registerMigrations() error { @@ -27,7 +28,7 @@ func registerMigrations() error { }, migration.Migration{ Description: "Migrate from random profile IDs to fingerprint-derived IDs", - Version: "v1.6.0", + Version: "v1.6.3", // Re-run after mixed results in v1.6.0 MigrateFunc: migrateToDerivedIDs, }, ) @@ -102,7 +103,7 @@ func migrateIcons(ctx context.Context, _, to *version.Version, db *database.Inte } // Migrate to icon list. - profile.Icons = []Icon{{ + profile.Icons = []icons.Icon{{ Type: profile.IconType, Value: profile.Icon, }} @@ -161,6 +162,8 @@ func migrateToDerivedIDs(ctx context.Context, _, to *version.Version, db *databa // Parse profile. profile, err := EnsureProfile(r) if err != nil { + failed++ + lastErr = err log.Tracer(ctx).Debugf("profiles: failed to parse profile %s for migration: %s", r.Key(), err) continue }