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 16 forks source link

[Android] Missing GPS Data #66

Closed tanvimurke closed 9 months ago

tanvimurke commented 11 months ago

Hi Team,

We have been using your app as a reference and have recently made some changes to ensure its compatibility with OS 12 and 13. However, we are currently encountering an issue related to the transfer of GPS files to the database. Since we value your expertise and experience with the app, we wanted to reach out to inquire if you have faced a similar issue in the past or are aware of it and its potential resolution. Any insights or assistance you can provide would be greatly appreciated. Looking forward to hearing from you soon.

Regards, Tanvi Murke Research Assistant, Carnegie Mellon University

biblicabeebli commented 11 months ago

~Is this specifically with ios 12/13, or more general? According to this chart the device would have to be strictly older than a the 6s generation. https://iosref.com/ios .~

~I have an iPhone 6+ that I can test ios 12 on, but working on this is a matter of time vs payout. Are you using an old device for testing, or do you have participants on old iOS versions?~

~There was a compatibility issue with iOS 15.7 that we were never able to track down, all non-survey data streams failed.~

~I will need you to do the following before I can do more:~ ~- make sure the version of the app on the device is "Beiwe2", "Beiwe" was removed from the app store maybe 6 months ago.~ ~- what exactly is the version of the app running? Up-to-date backend will display this on the participant page.~ ~- I need your exported study settings json - my email is my username at gmail if you would prefer to email rather than post that here.~ ~- iOS is heavily dependent on push notifications for app persistence. If you don't have those credentials please get in touch by email.~

tanvimurke commented 11 months ago

Thank you so much for reverting back. The issue I posted is with the Android app.

biblicabeebli commented 11 months ago

WOOPS. Uh. I'll update this tomorrow, my bad.

Do need that exported study info.

tanvimurke commented 11 months ago

Hi Eli,

No problem. Thank you so much.

Regards, Tanvi Murke

On Sun, Aug 6, 2023 at 11:34 PM Eli Jones @.***> wrote:

WOOPS. Uh. I'll update this tomorrow, my bad.

Do need that exported study info.

— Reply to this email directly, view it on GitHub https://github.com/onnela-lab/beiwe-android/issues/66#issuecomment-1667134504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7ZKW2QPDOVHN2WFZLDNM3XUBO4NANCNFSM6AAAAAA3AIAEIY . You are receiving this because you authored the thread.Message ID: @.***>

biblicabeebli commented 10 months ago

(My active work right now is on Android, adding new features that have been in development on iOS. I'm trying to get onto the app store as soon as possible, I'll include any fixes or changes discovered here if we can get them up. Bulk of the work on the feature ended yesterday, that feature has no overlap with this reported bug.)

I need the following from you:

biblicabeebli commented 10 months ago

(Updated the title of the issue so it's a little easier to track in our bug/issue tracker table.)

If you can take a screenshot of an affected participant page device info setting (or two or three) that will also help.

biblicabeebli commented 10 months ago

Thank you so much for reverting back.

Slightly lost, what was this comment with respect to? (or maybe it has become irrelevant?)

tanvimurke commented 10 months ago

Hi Eli,

I have attached one JSON file for your reference. Also, will it be possible for us to arrange a short call to discuss the issue so you can get a clear understanding? Looking forward to hearing from you soon.

Regards, Tanvi Murke

On Tue, Aug 8, 2023 at 3:08 PM Eli Jones @.***> wrote:

(My active work right now is on Android, adding new features that have been in development on iOS. I'm trying to get onto the app store as soon as possible, I'll include any fixes or changes discovered here if we can get them up. Bulk of the work on the feature ended yesterday, that feature has no overlap with this reported bug.)

I need the following from you:

  • I need that exported study settings json. The rest of this is immaterial until I have that.
  • Are participants in you study using the app version downloadable from the link on the website, or are they using the version of the app in the Play store? The Play store app will auto update (based on the user's personal settings), but the download link version will not.
  • The most up-to-date app version is 3.4.2. I need you to confirm that this is the version running on affected users. This information is present on the participant page provided your server is up-to-date.
  • On the participant dashboard (the table with statistics in it) it may be very helpful to get a sense of what data streams are/are not working. Get in touch out-of-band if you would like to do a call and a screen share, or you can take a screenshot.
  • Question: are you set up with push notification credentials on the backend server? Have you tested to confirm that they work? (I would have had to already provide you with push notification credentials out-of-band. I don't think this has happened.)
  • Question: are your participants reporting that the permanent notification is visible in their notifications menu? or is that missing.
  • To the best approximation, when did this issue start?

— Reply to this email directly, view it on GitHub https://github.com/onnela-lab/beiwe-android/issues/66#issuecomment-1670148061, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7ZKW4OAQHQWGM7PMG26R3XUKFDPANCNFSM6AAAAAA3AIAEIY . You are receiving this because you authored the thread.Message ID: @.***>

biblicabeebli commented 10 months ago

It looks like you are responding via the email interface to a github issue, the attachment was not forwarded. You will need to email me directly or go to the issue page. (issue 66)

tanvimurke commented 10 months ago

Hi Eli,

I am not able to attach the JSON file via Github. Could you please share your email id so I can send it to you there?

Regards, Tanvi Murke

biblicabeebli commented 10 months ago

it is my username at gmail dot com

biblicabeebli commented 10 months ago

I have reviewed data about participant data collection with respect to our own production servers and studies, and I've looked at your study configuration and found nothing unusual. It is not a common issue on the most recent version of the android app for participants who should have uploaded GPS data to have failed to.

Sometimes there are participants that do not allow location data permissions, this is the most likely cause here.

I asked for six additional data points and cannot continue without them.

biblicabeebli commented 10 months ago

I've done some more reviewing, turns out there is more of this going on than I first thought, but I do need to compare to other data streams to make a better determination.

tanvimurke commented 10 months ago

Hi Eli,

Thank you so much for the update. Adding @Sagar Baviskar @.***>

Regards, Tanvi Murke

biblicabeebli commented 10 months ago

I think I just found it. It's a permissions/permissions-checking bug.

Unless the participant followed the directions exactly, if they failed to go into the extra menu of permissions navigation and enable the background location permissions, our logic failed to test the situation correctly and would allow it. This caused inconsistent failure of GPS on a per-participant basis, and probably also was repeated each time by the participant if they ever reinstalled, because humans are predictable like that - but that's just speculation.

I JUST pushed version 3.5.0, wait for me to get 3.5.1 out - hopefully a today thing - and then have your participants update. (3.5.0 contains unrelated feature updates.) Watch on the participant page for their app version to say 3.5.1. If they are using the play store build of the app it will [hopefully] auto-update.

I've got a build running locally with the permission correctly re-popping up and forcing you back to the location permissions page.

TL;DR: not-out-yet app version 3.5.1 should force the participant to enable the correct permissions.

biblicabeebli commented 10 months ago

@hydawo note the above comment, get ready to notify active studies.

biblicabeebli commented 10 months ago

Ok, 3.5.1 is pushed.

It can take a day (usually just a few hours though) for the Play store update to roll out, but the version available at the link on Beiwe website pages now downloads 3.5.1. You may need to force-refresh the page to get it working.

Updates are Mostly lmited to the permissions fix, there's some Unavoidable Android 13 Compatibility Stuff included. (Hopefully that doesn't somehow screw us.)

biblicabeebli commented 10 months ago

For some reason - maybe the updated Android SDK target causing permissions requirements to change in the app manifest? - deployment isn't done yet for the Play Store. I've had to put it out for review a second time - I think. I don't understand what is going on.

(But the download-link on Beiwe webpages is updated.)

biblicabeebli commented 10 months ago

Current play store status is

You've submitted an update to your app. We'll update this page when we've finished the review. Reviews typically take up to 7 days. For more information, go to Publishing overview.

But the item in review is

App must target Android 13 (API level 33) or higher

Which... we do. The update is that, the 2 permissions fixes that that update required, and the bug fix from this thread.

Whatever. I will try and update this thread when its finally out, but I will die on the hill of this making no sense.

biblicabeebli commented 10 months ago

Ok it's FINALLY out on the app store. 🙄

hydawo commented 9 months ago

Closing this issue. Thread is not locked, will continue to respond if anything comes up on this thread.

biblicabeebli commented 9 months ago

Was interrupted an investigation where I was struggling to generate gps data after patching the data bug caused by locale number formatting.

(which is included in 3.5.2a)

Also, @tanvimurke stated the have patches regarding android 13. @tanvimurke , are those on a fork on github? or just local changes. I did my own patching but I missed something bad enough to hard-crash one of the two high-level feature builds outside of testing conditions. (The crash doesn't occur when deploying to the device from the dev environment, or when downloading from the app store. It only triggers when you build an apk, stick the file on the device, and install from there.)

biblicabeebli commented 9 months ago

I have now confirmed that the issue I was seeing was not related to normal operations, it was purely a local bug. GPS definitely records data.