Skip to content

tracks duplicated in visible tracks fixed#5532

Open
Vladyslav-lys wants to merge 5 commits into
masterfrom
tracks_duplicated_in_visible_tracks_ist_after_renaming
Open

tracks duplicated in visible tracks fixed#5532
Vladyslav-lys wants to merge 5 commits into
masterfrom
tracks_duplicated_in_visible_tracks_ist_after_renaming

Conversation

@Vladyslav-lys

Copy link
Copy Markdown
Contributor

No description provided.

@Vladyslav-lys

Copy link
Copy Markdown
Contributor Author

@tigrim tigrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Normalization is fixed only in this screen/helper, not at the persisted visible-track state boundary.
    File/function: OAAppSettings.m showGpx, hideGpx, updateGpx; OASelectedGPXHelper.mm buildGpxList

  2. loadGpxTracks() hides duplicate DB rows nondeterministically.
    File/function: MapSettingsGpxViewController.loadGpxTracks
    Why dangerous: filtering before sorting keeps whichever duplicate OAGPXDatabase.getDataItems() returns first. If one row is stale after rename, the UI may operate on the wrong GpxDataItem path while the real duplicate remains in the DB

@tigrim tigrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. TracksViewController.updateRenamedGpx ignores the result of gpxDB.renameCurrentFile(src, newFile: dest). If the DB rename returns false, the code still continues with handleDeletedGpxFile/addTrackItemToSmartFolder, which can leave the file, GPX DB, and smart folders out of sync. It would be safer to handle failure here similarly to OAGPXUIHelper.

  2. The fix normalizes specific rename paths, but the persisted visible tracks state is still compared as raw strings in OAAppSettings showGpx/updateGpx/hideGpx and OASelectedGPXHelper/buildGpxList. If a path reaches mapSettingVisibleGpx from another entry point in a different Unicode form, the issue may come back. It may be better to normalize or compare paths at the mapSettingVisibleGpx boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracks duplicated in "Visible Tracks" list after renaming using accented characters (e.g., 'A' to 'Á') due to string normalization issue

2 participants