Skip to content

Commit

Permalink
Fix: remove truly unrecoverable changes from report logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pietervdvn committed Oct 9, 2024
1 parent 6a4166f commit f2b681c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Logic/Osm/Changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit f2b681c

Please sign in to comment.