famoser/Mensa

Data loss while using the app (title changes after on-screen rotation)

Closed this issue · 4 comments

When I perform these sequences of events, the title changes after on-screen rotation:

  1. Go to the Main activity
  2. Tap on the first element to expand the list
  3. Tap the first in the list
  4. A fragment similar to this will appear:

Before rotation:

  1. Force the pause from the activity and then return to the activity (double rotation). Note that title changes after on-screen rotation.
    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 title of the previous image.

However, the title changes to Mensa Detail.

After rotation:

Device:

  • Device: Moto G30 with OS: Android 11
  • Version: 1.5.6
  • Device language: English

We found similar flaws in MainActivity :

When executing this sequence of actions, there is a loss of data in the activity

KeyEvent(name=BACK)
IntentEvent(intent='am start ch.famoser.mensa/ch.famoser.mensa.activities.MainActivity')
ScrollEvent(direction=UP) [[0,54],[720,1558]]

Cap01: capture screen properties before rotation
DoubleRotationEvent
Cap02: capture screen properties after rotation

Cap01 != Cap02 (many properties changed)

//////////////////////////////////////////////////////////////////////////////////////////////////////
TouchEvent [[650,54],[720,119]]
Cap01: capture screen properties before rotation
DoubleRotationEvent
Cap02: capture screen properties after rotation

Cap01 != Cap02 (menu box with checkboxes disappeared)

Note:

  • Double screen rotation: It is executed twice to reach a state that should be exactly the same as the screen before if no data loss occurred.
  • A data loss problem occurs when data is accidentally deleted or state variables are accidentally assigned with default or initial values.

Hi davirec! Sorry, did not meant to ignore you, somehow notifications went past me.

I'll take a look at it sometime next week. From what I can tell so far, the impact seems to be minor. However, it hints that the app currently does not store/recover state correctly when activities are restarted (which is the case everytime the screen is rotated).

Feel free to create pull request if you can take a closer look at it by yourself until then.

Hi fomoser! Thank you.

Upon thoroughly testing the app for the ETH API change, I was never impacted by this. Closing this now. Feel free to create another issue or a fixing PR if this really impacts you.