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
26 stars 17 forks source link

Survey notifications reappear for completed surveys on app close #14

Closed zagorsky closed 2 years ago

zagorsky commented 7 years ago

@mariasimoneau says:

tester [Kenzie?] noticed that the surveys are repeated when she actually closes the app. For example, if she completes the survey(s) and then closes out of the app to 'save battery,' she will get a notification to complete the same surveys. This will keep happening as long as she closes out of the app. If she doesn't close out of the app, then she does not get the repeated notifications.

I split this off from beiwe-backend Issue 6.

zagorsky commented 7 years ago

I've tried to reproduce this but haven't yet been able to.

@kwcarlso, does this happen on all Android phones? If it happens on some of them, which ones does it happen on? Does it happen reliably, every time you close the app, or only sometimes, and if only sometimes, are you able to recognize a pattern in when it happens?

zagorsky commented 7 years ago

@kwcarlso says via email:

This has happened on multiple Android phones and it happens when a survey is sent for one week then deleted, then it is received again exactly a week after the first time it went through, as if the survey had never been deleted.

Hi @kwcarlso, there are two separate issues here:

  1. One issue is that when you delete the future scheduled times for a survey, the Android app shows one more survey notification after it's been deleted. That issue is described here and is fixed by Beiwe Android app version 2.1.4.

  2. Separate from the first issue, Maria described that when you closed the app after taking the survey, the same survey notification reappeared, and it seemed to be caused by you closing the app. Do I understand that correctly? Did you finish taking a survey, submit the answers, close the app from the app switcher menu, and then see the survey notification reappear?

mariasimoneau commented 7 years ago
    • ok
  1. perhaps this is better under the "surveys not deleting" github issue. or maybe it's the same problem since it does seem related to closing the app. Synopsis: delete all surveys. shut phone off and get reliably get survey notifications when phone powers up. most times, when the beiwe app is closed notifications also appear - but this is less reliable than powering down the phone.

tested three phones: android 5 with 2.1.3, android 5 with 2.1.4, android 4.4.2 with 2.1.4. -set up survey id f0a7 for 10 deliveries 8am 3:30pm - 3:36pm,3:45, 4pm , 5pm 3pm-3:35. take surveys, tried logging out in between. tried closing app in between- no problem, survey notifications arrived as expected. took all surveys and submitted. -3:35 deleted all surveys, (left "show survey notification immediately" checked.)
-do not receive 2 deleted surveys that had been scheduled. (3:36 and 3:45) -3:46 shut off phones (two shut off happened to be plugged in), the third did a restart. all power up - no surveys. closed apps - no surveys (i think this is a red herring - didn't shut phone off long enough) -3:54 shut off phones -- leave them off until 4:01. (survey now deleted had been scheduled for 4).
-4:01 power up phones - no surveys. press on beiwe icon - all three phones have surveys. (take surveys to clear notifications) -4:30 - close all apps. immediately get notifications on two of the phones -4:37 power off 3 phones 4:43 power up phones - surveys notifications arrive on all three phones -- so this isn't related to previously scheduled surveys. it's a random "phantom" survey. the timestamps on the surveys are a few minutes after the phone powers up.

I hope this is clear! let me know if not.

I'm on HSPH test study maria.

mariasimoneau commented 7 years ago

sorry I keep characterizing this improperly. it's "delete the scheduled deliveries" on a survey, not "delete the survey". the survey is not deleted, only its schedule.

Synopsis: delete the schedule for a survey so no deliveries are scheduled. shut phone off and reliably get survey notifications when phone powers up. most times, when the beiwe app is closed notifications also appear - but this is less reliable than powering down the phone. it's a "phantom" survey -- not connected to the previous schedule. I tried this again without "show survey notification immediately" and the result was the same - phantom surveys continue to appear. You had noted this was a dead end so I'm just confirming that. A week later, the surveys still appear if the battery dies & i turn the phone on. no surveys on the entire study are scheduled. all the schedules were/are deleted.

zagorsky commented 7 years ago

Hi @mariasimoneau,

  1. Is this happening with Android version 2.1.3 or 2.1.4?
  2. Is this different than the problem described in https://github.com/onnela-lab/beiwe-backend/issues/6?
  3. When you say "when the beiwe app is closed notifications also appear", do you mean "when I close the Beiwe app, a notification immediately appears", or do you mean "notifications appear at times when the Beiwe app is not open"?
  4. Should I investigate this further or are you saying that this issue is a dead end and not worth investigating?
mariasimoneau commented 7 years ago
  1. both
  2. no, apparently not. You fixed part of this in 2.1.4, (lingering previously scheduled surveys) but part of the problem remains. I'm calling this the "phantom" survey as it's not related to the now-deleted previous schedule. it seems simply related to closing the app and/or powering down the phone.
  3. thanks for clarifying. I mean "when I close the Beiwe app, a notification immediately appears"
  4. When the enhanced scheduling is available using the push notifications architecture from the server, I assume this problem is no longer pertinent. Thus, I'd say it's a low priority for now.

    I just wanted to note the problem and this seems like a good place to keep track of things (though sorry we have two related issues for it... hope to get more organized on the "issues" moving forward. (ie no duplicates, one issue per issue number, etc.) thanks

biblicabeebli commented 2 years ago

This issue is substantially out of date and also underlying behavior and notification serving via push notifications from the backend have changed, closing this issue. (also it is ancient.)