Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] Bookmark's edited name is not saved after selecting in which folder to save #7854

Closed
lobontiumira opened this issue Jan 22, 2020 · 5 comments
Assignees
Labels
🐞 bug Crashes, Something isn't working, .. eng:qa:verified QA Verified eng:ready Ready for engineering Feature:Bookmarks S2 Major Functionality/product severely impaired and a satisfactory workaround doesn't exist

Comments

@lobontiumira
Copy link

lobontiumira commented Jan 22, 2020

Steps to reproduce

  1. Open a page and bookmark it.
  2. Tap on "Edit" from the snackbar.
  3. Edit the "Name", then tap on the folder to select where to save the new bookmark.
  4. After selecting in which folder to save, tap the back arrow and observe.

Expected behavior

The edited name is still displayed.

Actual behavior

The edited name is not saved. If the page had a name, that one is displayed, if it didn't, the "Name" section is blank.

Device information

  • Android device: Google Pixel (Android 10), Google Pixel 3A (Android 9)
  • Fenix version: Beta 3.2.0-beta.1, 01/22 Nightly build

20200122

┆Issue is synchronized with this Jira Task

@lobontiumira lobontiumira added 🐞 bug Crashes, Something isn't working, .. Feature:Bookmarks S2 Major Functionality/product severely impaired and a satisfactory workaround doesn't exist labels Jan 22, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Jan 22, 2020
@mcarare mcarare removed the needs:triage Issue needs triage label Jan 22, 2020
@sv-sdeiac
Copy link

The same issue is reproducible also editing the bookmark folder name using the same steps as in the description.

Device:

  • Samsung Galaxy Tab S3 (Android 8).
  • Fenix version: Beta 3.2.0-beta.1

@juan-goncalves
Copy link
Contributor

I'd like to work on this issue, is it still available?

@ekager
Copy link
Contributor

ekager commented Apr 15, 2020

Yep! Go for it @juan-goncalves

@ekager ekager added the eng:ready Ready for engineering label Apr 15, 2020
@juan-goncalves
Copy link
Contributor

juan-goncalves commented Apr 15, 2020

As the EditBookmarkFragment onViewCreated method loads the bookmark data from a PlacesBookmarkStorage, when we navigate to another screen and return, the view is recreated and the onViewCreated method is triggered once again, querying the bookmark storage and updating the fragment's EditTexts with the saved values, losing the user's input.

A simple fix would be to compare the bookmark node from storage with the one that the fragment already had a reference to (in the bookmarkNode attribute), updating the EditTexts only if they are effectively different.

Currently they would only be different when the fragment is created the first time, as the bookmarkNode would be null and after fetching it from the storage it would have some other value. When we are navigating back to the fragment, its bookmarkNode will already have a reference to a bookmark, so the EditTexts won't be updated.

kglazko pushed a commit that referenced this issue May 18, 2020
As the bookmark node data is loaded from storage every time the fragment's view is created, when the user navigates to the SelectFolderFragment and returns, the bookmark is loaded once again from storage, replacing the EditText's content (title and URL) which causes the loss of user input.

Validating that the loaded bookmark is different from the one that is already referenced in the fragment avoids unnecessarily replacing the `EditText`s values.
@sflorean
Copy link
Contributor

Verified as fixed on Nightly 5/19 and 5.1-beta.1 builds.
Devices: Nokia 6 (Android 7.1.1), Samsung Galaxy Note 10 (Android 10), Xiaomi Mi Pad 2 (Android 5.1).

@sflorean sflorean added the eng:qa:verified QA Verified label May 19, 2020
@liuche liuche mentioned this issue May 19, 2020
32 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. eng:qa:verified QA Verified eng:ready Ready for engineering Feature:Bookmarks S2 Major Functionality/product severely impaired and a satisfactory workaround doesn't exist
Projects
None yet
Development

No branches or pull requests

6 participants