nucleus-ffm / foss_warn

An unofficial open source application to get emergency alerts from https://warnung.bund.de/meldungen.
GNU General Public License v3.0
98 stars 6 forks source link

Loosing "already read" state of messages #123

Open mstammberger opened 2 months ago

mstammberger commented 2 months ago

The "already read" state (greeen icon) of messages of a location is lost when going back to main screen.

Let me explain that by example:

  1. Main screen shows the big red exclamation icon for my (single) location. Fine.
  2. Tipping on that location opens the list of warnings for that location. Fine.
  3. In my case there is one unread warning shown with the red alert icon. Fine.
  4. Tipping on the warning opens it's description. Fine.
  5. Tipping the upper left arrow button goes back to the messages list. Fine.
  6. The message is now shown as "already read" with the green icon. Fine.
  7. Tipping the upper left arrow button goes back to the main screen. Fine.
  8. Main screen shows still the big red exclamation icon for the location. WRONG!
  9. Tipping again on that location opens the list of warnings for that location. Fine.
  10. The warning message is now again shown with the red alert icon. WRONG!

The steps from 4. to 10. can be repeated several times. Always the same behaviour!

Only if the message is marked as "already read" by tipping on its small alert icon (changing it to green) then the state is correctly assigned:

  1. Tipping on the small alert icon of the message changes the icon to green (read). Fine.
  2. Tipping the upper left arrow button goes back to the main screen. Fine.
  3. Main screen shows now the big gray icon (no new warnings) for my (single) location. Fine.
  4. Tipping on that location opens the list of warnings for that location. Fine.
  5. The warning is now shown with the green icon. Fine.

From now on the messages keep the state "already read".

Device :

Same behaviour on a Samsung A5 2017 with eOS 1.x

nucleus-ffm commented 2 months ago

Thanks for the issue. This bug has already been fixed with version 0.6.1 (https://github.com/nucleus-ffm/foss_warn/pull/101). Please update to the newest version either via F-Droid or Github. If the problem remains, feel free to reopen this issue.

mstammberger commented 2 months ago

I'm not sure whether the issue is really fixed in complete. In the meantime I'm using version 070 (beta). Yesterday I received a warning and if I remember correctly the state was not updated in the main screen when going back from the location's warning list screen. Maybe I was using the phone's back button instead of the app's upper left arrow button (can't remember). I will examine and test it more detailled when the next warning will arrive.

mstammberger commented 2 months ago

Sorry, I can't reopen that issue by myself. I think It would require the user role "colaborator".

mstammberger commented 2 months ago

As I already reported: The issue still exists in 0.7.0 (beta):

Yesterday I received a new warning message and I was able to reproduce the behaviour:

  1. In overview screen the big round red warning icon is visible for a location
  2. Open the location entry
  3. In the list of warnings the entry is marked correctly with the small red exclamation icon
  4. Open the warning
  5. Go back with top-left arrow
  6. In the list of warnings the entry is now marked correctly with the green 'already read' icon
  7. Go back with top-left arrow
  8. WRONG: In overview screen the big round red warning icon is still visible!
  9. Open it the loacation entry again.
  10. WRONG: In the list of warnings the entry is again marked with the small red exclamation icon
  11. Open the warning again
  12. Go again back with top-left arrow
  13. In the list of warnings the entry is now marked correctly with the green 'already read' icon
  14. Go back with top-left arrow
  15. WRONG: In overview screen the big round red warning icon is still visible!

While testing I encountered some situations where all icons were updated but I can't remember exactly when this happened (I think the overview icon is updated to the gray one when I marked the warning message as read manually in the list of warnings. Additionally: When I close the App and reopen it, the warning is again marked as unread and I am able to reproduce the behaviour.

Please note, that I always used the top-left arrow button for back navigation.

I'm using FOSS Warn on a OnePlus Nord (avicii) with custom ROM /e/OS 1.21-s (stable build). It's based on LineageOS 19 (Android 12).

nucleus-ffm commented 1 month ago

We could reproduce the behavior when we launch the app with a notification. If we open the app normally, the warnings are correctly marked as read the first time. Can you confirm that the issue only happens when the app is launched via a notification?

To test the behavior, you can select any place with an ongoing alert, use the developer settings in the app, and use the "Delete list of read warnings [...]" and the "test notification" buttons.

Additionally: When I close the App and reopen it, the warning is again marked as unread and I am able to reproduce the behaviour.

Do you mean when the place overview shows a grey sign and the warnings are correctly marked as read, and you close the app and reopen it, the warnings are again marked as unread?

mstammberger commented 1 month ago

Can you confirm that the issue only happens when the app is launched via a notification?

I can't remember how I opened the App the first time the new warning was received. But I can confirm that it happened also, when I opened the App "normally" a second time to reproduce the behaviour.

Do you mean when the place overview shows a grey sign and the warnings are correctly marked as read, and you close the app and reopen it, the warnings are again marked as unread?

Yes, exactly!

I think there will be a new warning tonight (we will probably have a thunderstorm in our region). Then I will have another look on the issue. As suggested I deleted the list of warnings and additionally closed the App completely by OS Apps settings and restarted it then.

mstammberger commented 1 month ago

Update:

In the meantime I use version 0.7.1 (beta)

In the last few days I have received several warning messages and the app's behavior was always identical:

  1. In overview screen the big round red warning icon is visible for a location
  2. Open the location entry
  3. In the list of warnings the entry is marked correctly with the small red exclamation icon
  4. Open the warning
  5. Go back with top-left arrow
  6. In the list of warnings the entry is now marked correctly with the green 'already read' icon
  7. Go back with top-left arrow
  8. WRONG: In overview screen the big round red warning icon is still visible!

Now repeat the steps a second time:

  1. Open the location entry again
  2. WRONG: In the list of warnings the entry is again marked with the small red exclamation icon
  3. Open the warning again
  4. Go again back with top-left arrow
  5. In the list of warnings the entry is now marked correctly with the green 'already read' icon
  6. Go back with top-left arrow
  7. CORRECT: Main screen shows now the big gray icon (no new warnings) for the location

Please note: In my initial report (with version 0.6.0) the behaviour in step 15 was not correct! The steps 1 - 8 could be repeated several times always with the same wrong result. Maybe there is an undefined variable dangling or there are related code changes to version 0.7.1.

From now on all icons are correct:

  1. Open the location entry again
  2. In the list of warnings the entry is marked correctly with the green 'already read' icon
  3. Open the warning again
  4. Go again back with top-left arrow
  5. In the list of warnings the entry is still marked correctly with the green 'already read' icon
  6. Go back with top-left arrow
  7. Main screen shows still the correct big gray icon (no new warnings) for the location

Steps 16 - 22 can be repeated as often as you want. Even after restarting the App the icons are always correct (that differs from my original observation I mentioned on 9th of July).

I opened the App always by its App Icon (not via the notification).

[Edited just typos]