From f2b681caa59a419c4c217e705ad6d1a7ac271128 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 9 Oct 2024 22:55:12 +0200 Subject: [PATCH] Fix: remove truly unrecoverable changes from report logging --- src/Logic/Osm/Changes.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Logic/Osm/Changes.ts b/src/Logic/Osm/Changes.ts index c84fa9b18c..a44aa4a02a 100644 --- a/src/Logic/Osm/Changes.ts +++ b/src/Logic/Osm/Changes.ts @@ -72,7 +72,7 @@ export class Changes { this.backend = state.osmConnection.Backend() this._reportError = reportError this._changesetHandler = new ChangesetHandler( - state.featureSwitches.featureSwitchIsTesting, + state.featureSwitches?.featureSwitchIsTesting ?? new ImmutableStore(false), state.osmConnection, state.featureProperties, this, @@ -837,7 +837,12 @@ export class Changes { ) // We keep all the refused changes to try them again - this.pendingChanges.setData(refusedChanges.flatMap((c) => c)) + this.pendingChanges.setData(refusedChanges.flatMap((c) => c).filter(c => { + if(c.id === null || c.id === undefined){ + return false + } + return true + })) } catch (e) { console.error( "Could not handle changes - probably an old, pending changeset in localstorage with an invalid format; erasing those",