Skip to content

fix: remove favorite marker from map immediately after deletion - #1636

Open
sim6 wants to merge 1 commit into
nextcloud:masterfrom
sim6:fix_remove_favorite_marker_from_map_immediately_after_deletion
Open

fix: remove favorite marker from map immediately after deletion#1636
sim6 wants to merge 1 commit into
nextcloud:masterfrom
sim6:fix_remove_favorite_marker_from_map_immediately_after_deletion

Conversation

@sim6

@sim6 sim6 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Replace this.$delete() with native delete in all favorite deletion paths (single delete, bulk delete, category unlink).

this.$delete() is a Vue 2 compatibility shim that may not reliably trigger Vue 3's Proxy-based reactivity system when removing keys from a reactive object. This caused the FavoritesLayer deep watcher on displayedFavorites to not fire, leaving stale markers on the map until a full reload.

In Vue 3, the native delete operator is intercepted by the Proxy's deleteProperty trap, which properly triggers reactivity.

Affected methods:

  • onFavoriteDelete (single favorite via sidebar/popup)
  • onFavoritesDelete (bulk delete via cluster right-click)
  • onDeleteFavoriteCategoryFromMap (unlink shared category)

Replace `this.$delete()` with native `delete` in all favorite
deletion paths (single delete, bulk delete, category unlink).

`this.$delete()` is a Vue 2 compatibility shim that may not reliably
trigger Vue 3's Proxy-based reactivity system when removing keys from a
reactive object. This caused the FavoritesLayer deep watcher on
displayedFavorites to not fire, leaving stale markers on the map until
a full reload.

In Vue 3, the native `delete` operator is intercepted by the Proxy's
deleteProperty trap, which properly triggers reactivity.

Affected methods:
- onFavoriteDelete (single favorite via sidebar/popup)
- onFavoritesDelete (bulk delete via cluster right-click)
- onDeleteFavoriteCategoryFromMap (unlink shared category)

Signed-off-by: Simó Albert i Beltran <sim6@probeta.net>
@sim6

sim6 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@CarlSchwan Could you review it?

@CarlSchwan
CarlSchwan enabled auto-merge July 30, 2026 14:17
@CarlSchwan

Copy link
Copy Markdown
Member

Thanks for the fix and sorry for the delay, so much stuff to do lately on my $work time :(

@sim6

sim6 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

The test failures are infrastructure-related, not code-related.

@sim6

sim6 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@CarlSchwan No rush at all, and thanks for your work on this.

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.

2 participants