New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[android] Fixed the crash while clicking on Deleted Bookmarks #5047
[android] Fixed the crash while clicking on Deleted Bookmarks #5047
Conversation
d66bb65
to
efe9286
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Pixel 6 - Android 13
Hi @biodranik, can you please review and merge this PR if it looks ok. It's been pending over 2 weeks. |
Looks like there is a bug in the C++ bookmark_manager. The notification is not sent from the core because the
Note also that there is a separate Looks like the code was written by different people, who did not implement it properly. On iOS, for example, the UI code manually removes the deleted list item and do not use any subscription at all. A proper fix is likely to fix notification and leverage correct notification for categories/lists (not for bookmarks). And also do it properly on iOS. A better quick-and-dirty workaround than the existing in this PR could be to delete the list item from the Android UI code without using such notifications. WDYT? |
@biodranik, TBH I don't think we can do the removal of the list item from the Android UI Code as the underlying dataset for Android List is backed by Anyways, the Android code is heavily using Let me know WDYT ?? |
What about fixing the C++ code by sending the notification, as I suggested, in the right way? |
That is the best approach. However, the current solution is only going to impact Android side of things. As |
iOS doesn't use this code. But it can start using it later. Or it can be used on desktops. Please fix the non-working c++ notification. |
Hi @abhibana , did you have a chance to take a look at this issue? |
up. Please rebase at least. I can't do that via UI :( |
On Bookmarks Lists page, if a User has created a new List along with `My Places` List and then deletes it, the deleted item stays on the List. Now, if the user clicks on the deleted List Item then the app was crashing as the deleted item is unavailable. Root cause of this issue is below - - When a `category` is deleted then `deleteCategory()` of `BookmarkManager` gets called. - The `deleteCategory()` internally calls `nativeDeleteCategory()`. - After a `category` is successfully deleted, then `OnBookmarksChanged()` should be invoked in order to update the List. But this wasn't happening. So deleted category wasn't getting removed from the cached list. Thus the user deleted category was visible even after deletion. - When the user clicked on the deleted `category`, it'll eventually crash as the `category` itself isn't present Fix: Properly notify the UI about the deleted list from BookmarkManager::NotifyChanges() Fixes: organicmaps#3828 Signed-off-by: Abhishek Bandyopadhyay <abhishek.gnit.ece@gmail.com> Signed-off-by: Alexander Borsuk <me@alex.bio>
efe9286
to
8027cb6
Compare
@biodranik I'm unfamiliar with this logic, but isn't the same case here? Can you please check if you are already in a context?
|
@vng there is no way to delete the track right now. And there is no way to add/create a track from the bookmarks dialog now. So this case will work. I propose to review and test this logic later, when we implement track recording and deleting. It looks unnecessarily complex. |
Thanks for the contribution!! |
On Bookmarks Lists page, if a User has created a new List along with
My Places
List and then deletes it, the deleted item stays on the List. Now, if the user clicks on the deleted List Item then the app was crashing as the deleted item is unavailable. Root cause of this issue is below -category
is deleted thendeleteCategory()
ofBookmarkManager
gets called.deleteCategory()
internally callsnativeDeleteCategory()
.category
is successfully deleted, thenOnBookmarksChanged()
should be invoked in order to update the List. But this wasn't happening. So deleted category wasn't getting removed from the cached list. Thus the user deleted category was visible even after deletion.category
, it'll eventually crash as thecategory
itself isn't presentFix: Added a
OnBookmarksChanged()
call invocation onsuccessful
deletion of categoryFixes: #3828