etesync / android

EteSync - Secure, end-to-end encrypted, and privacy respecting sync for your contacts, calendars and tasks.
https://www.etesync.com
GNU General Public License v3.0
305 stars 34 forks source link

Unsaved form data isn't persisted when app is paused #202

Open davirec opened 2 years ago

davirec commented 2 years ago

When I perform these sequences of events, the text disappears:

  1. Go to the Main activity (Welcome to EteSync!)
  2. Tap in add (plus in the right bottom)
  3. Tap in Sign Up
  4. Write username, email, and password.
  5. A activity similar to this will appear:
  1. Force the pause from the activity and then return to the activity (double rotation). Note that the text disappears. Note: the pause from activity can be performed in several ways. We suggest using a double rotation (starts in portrait, goes to landscape, and back to portrait) with this function previously enabled in the smartphone.

The expected behavior is the return to the previous state with the text of the last image.

However, the text disappears.

Device:

tasn commented 2 years ago

What do you mean by data loss? No actual data loss, just the active form data is wiped when you are still actively using it?

davirec commented 2 years ago

A data loss problem occurs when data is accidentally deleted or state variables are accidentally assigned with default or initial values. This issue is related to the activity's lifecycle (1). When a screen rotation occurs, the activity is destroyed and resumed. Data loss will happen if the developer does not save the variables before the destruction and restore them after creation. It can be done through lifecycle callback implementation.

  1. https://developer.android.com/guide/components/activities/activity-lifecycle
tasn commented 2 years ago

Yeah, I'm aware of the process you're describing. It's just not "data loss" which usually means persisted data was lost. This is a case of a minor (yet annoying!) UI inconvenience.