onnela-lab / beiwe-android

Beiwe is a smartphone-based digital phenotyping research platform. This is the Beiwe Android app code. The Beiwe2 app is also available on the Google Play store to use with open source builds of the Beiwe backend.
https://www.beiwe.org/
BSD 3-Clause "New" or "Revised" License
27 stars 16 forks source link

Repetitive/persistent Android notifications after survey completion #64

Closed hydawo closed 1 year ago

hydawo commented 1 year ago

@biblicabeebli an Android user (tzgxnl2y) in the "MGH Berry Feasibility and Sensitivity of a SMART for Amyotrophic Lateral Sclerosis 3.0" study reported receiving repetitive/persistent notifications even after completing a survey. Their data streams look good and nothing out of the ordinary for survey answers/timings streams. Here is what the user reported to the study team:

I get reminders to do the surveys. I click the reminder and it brings me to the app and the survey. I hit submit when completed, and before that reminder would go away. Now it just reappears with the present time .

For example. I get the reminder at 10am. If I do the survey at 11am, I get a reminder for the time I did the survey. And all the reminders at that moment get updated to the present time. And it just keeps flipping as it updates the time. It updates every minute, so my inbox is flipping non-stop. It is wild. It really is interfering with my phone.

I can’t even catch a picture as it flips so quickly so I had my brother take a picture of it. You can see the time is 9:04 pm on all of them. That will change every minute.

I have done multiple surveys, but they all reappear. Nothing goes away.

Participant's Beiwe Notifications

I asked the study coordinator to have the user perform a full uninstall, restart, and re-registration with "Easy Enrollment" enabled. Based on their activity times, it looks like they completed this late last Friday (3/17/23):

Google Chrome at 10 51 14 on 2023-03-21@2x

I'll follow up with the study team to find out whether this resolved the issue.

hydawo commented 1 year ago

@biblicabeebli User "8yaopikd" in the "University of Washington_Nehra_RESTORE" study reported a similar issue though they weren't able to provide a screenshot.

I advised their study team to do the same as above (full uninstall, restart phone, un-register device, reinstall, re-register using same ID).

hydawo commented 1 year ago

@biblicabeebli User "8yaopikd" in the "University of Washington_Nehra_RESTORE" study reported a similar issue though they weren't able to provide a screenshot.

I advised their study team to do the same as above (full uninstall, restart phone, un-register device, reinstall, re-register using same ID).

joannakennedyharvard commented 1 year ago

Users "42t6jgb4" and "z8tcvqyk" in the "NHS3/GUTS Beiwe Smartphone Study_1" study reported a similar issue without a screenshot.

I advised their team to do the same as above (full uninstall, restart phone, un-register device, reinstall, re-register using same ID).

biblicabeebli commented 1 year ago

I've skimmed this issue, thanks for the details, I will try to look into it, I'm just currently in iOS land.

Candidate sources are bugs in the survey scheduling logic, the notification management logic, or in persistence behavior causing background service restarts. My guess is notifications, and its probably not a push notifications bug.

joannakennedyharvard commented 1 year ago

Also, user "a95c8qzw" from the same "NHS3/GUTS Beiwe Smartphone Study_1" study.

This user uninstalled and reinstalled (full uninstall, restart phone, un-register device, reinstall, re-register using same ID). The study team says this seemed to solve the problem for this participant.

biblicabeebli commented 1 year ago

Thaaaaat's weird, indicates some sort of cumulative glitch.

hydawo commented 1 year ago

Only the NHS3/GUTS study has let us know that a reinstallation/reregistration resolved the issue. I have not heard back from the other teams yet. We did ask the NHS3/GUTS team to let us know if this issue recurs for the same user (a95c8qzw) or if it starts happening for other users.

joannakennedyharvard commented 1 year ago

User "kjhi74g5" from the [MGH Berry Feasibility and Sensitivity of a SMART for Amyotrophic Lateral Sclerosis 2.0](MGH Berry Feasibility and Sensitivity of a SMART for Amyotrophic Lateral Sclerosis 2.0) with a similar issue without a screenshot.

I advised their team to do the same as above (full uninstall, restart phone, un-register device, reinstall, re-register using same ID) and asked about if those steps solved the issue for their user "tzgxnl2y" that provided the screenshots above.

hydawo commented 1 year ago

@biblicabeebli an Android user (tzgxnl2y) in the "MGH Berry Feasibility and Sensitivity of a SMART for Amyotrophic Lateral Sclerosis 3.0" study reported receiving repetitive/persistent notifications even after completing a survey. Their data streams look good and nothing out of the ordinary for survey answers/timings streams. Here is what the user reported to the study team:

I get reminders to do the surveys. I click the reminder and it brings me to the app and the survey. I hit submit when completed, and before that reminder would go away. Now it just reappears with the present time . For example. I get the reminder at 10am. If I do the survey at 11am, I get a reminder for the time I did the survey. And all the reminders at that moment get updated to the present time. And it just keeps flipping as it updates the time. It updates every minute, so my inbox is flipping non-stop. It is wild. It really is interfering with my phone. I can’t even catch a picture as it flips so quickly so I had my brother take a picture of it. You can see the time is 9:04 pm on all of them. That will change every minute. I have done multiple surveys, but they all reappear. Nothing goes away. Participant's Beiwe Notifications

I asked the study coordinator to have the user perform a full uninstall, restart, and re-registration with "Easy Enrollment" enabled. Based on their activity times, it looks like they completed this late last Friday (3/17/23):

Google Chrome at 10 51 14 on 2023-03-21@2x

I'll follow up with the study team to find out whether this resolved the issue.

This same user is reporting this issue again (after reinstallation/reregistration fixed the issue for a short period of time). @biblicabeebli can we please look into this ASAP?

Thank you!

hydawo commented 1 year ago

@biblicabeebli moving this to current sprint

biblicabeebli commented 1 year ago

Working on it!

biblicabeebli commented 1 year ago

I have a custom beiwe build with a very quick fix, it patches the notification logic to check active notifications before doing its thing. This is not ready for public release or on the play store, it is for testing purposes only. App version is currently 3.4.2a.

Can be downloaded here: https://drive.google.com/drive/folders/1g0zQmwtvhVYIr2QBa5qSexUuvL4kiU1a?usp=sharing

biblicabeebli commented 1 year ago

After more review I noticed that first user's study has 10-second intervals for the accelerometer data stream - the way version 3.4.x of the android app works is that it runs ALL the app-state logic whenever ANY timer event triggers. My guess is that this issue is only being encountered by participants in studies with these very frequent events, or at least it isn't noticed by other people. (We will never get a report of every weird ui glitch or bug.)

The only detail I don't understand is why the survey notification is not getting dismissed for some participants. I've checked the code - there are no special identifiers, everything is premised on the survey id and there can only be one survey notification per survey id, and the dismissNotification function works as expected. I think this is just user error due to the notifications not stating which survey they point to.

biblicabeebli commented 1 year ago

I have now been able to replicate the scenario the user is seeing. I think the animation of shifting notification sliding around is skipped if there are only 2 or 3, or if the device is slow. My fix fixes it.

I think its ok to push the fix out immediately.

biblicabeebli commented 1 year ago

yeah, I've sat on it for a day, this is safe, I'm pushing it.

biblicabeebli commented 1 year ago

App version 3.4.2 is live on the link on the bottom of beiwe website pages, in-process for the app store.

biblicabeebli commented 1 year ago

@hydawo you can update people that there is a probable fix out / out-soon.

biblicabeebli commented 1 year ago

It is now pushed to the app store via the normal process. @hydawo I'm shifting this to Done, going to let you close the issue based on client feedback.

hydawo commented 1 year ago

@biblicabeebli great thanks Eli, we will start having studies install the new Android version and report back on any further issues. We will keep this open for now...