onnela-lab / beiwe-backend

Beiwe is a smartphone-based digital phenotyping research platform. This is the Beiwe backend code
https://www.beiwe.org/
BSD 3-Clause "New" or "Revised" License
63 stars 43 forks source link

Feature - Disable data upload on a study #364

Open biblicabeebli opened 5 months ago

biblicabeebli commented 5 months ago

Make a (toggleable?) setting in study settings to shut down (block any new upload) a study. Data download, dashboard, forest etc should remain available.

Presumably there should be a beiwe-app-side feature to Detect when the study is over.

hydawo commented 5 months ago

@biblicabeebli we would like to develop 2 separate features, both of which would stop all data upload to a study

  1. Disable upload/close study button on "Edit Study" page that is only accessible by Site-Admins. This would stop any further data upload to the study, but would not delete/hide the study. This button would be a toggle so it can be reversed if necessary.
  2. A field on "Edit Study" page that allows Site-Admins to designate a specific date at which time data upload would automatically stop.
biblicabeebli commented 2 months ago

Work has begun on this feature, branch stop-studies. Have a vaguely-working, unfinished, no tests yet, prototype locally.

biblicabeebli commented 2 months ago

There is now an end-date and manually end study feature implemented, it is on our staging server for testing.

Need to add an indicator that "the study you are looking at has ended."

biblicabeebli commented 2 months ago

There are now some messages in the ... messages area telling the user that the study is stopped. Pages are the main dashboard page, view study, edit study, edit study device settings pages.

biblicabeebli commented 2 months ago

Made some more tests, fixed a bug, updated messages some.

biblicabeebli commented 1 month ago

"... This means that no further surveys will be sent out..."

I need to make sure it doesn't do that. That would be silly.

What happens if you try to pull the hidden study's data from the API?

It should fail, but it is kinda undefined behavior? I'll have to poke around and make sure we are locking it. It's possible that only some endpoints will fail/return no data, it should be universal. (Context: This is the old "delete study" feature but it is now named appropriately. We never want to actually delete studies, so important details have gone unexamined. And I tend to forget about it.)

biblicabeebli commented 1 month ago

I updated push notifications (schedules and other) they no longer work for ended, hidden, or manually stopped studies.

Authentication wrappers: they should already block hidden studies, they should NOT be made to block ended or manually stopped studies.

biblicabeebli commented 1 month ago

and now authentication wrappers all block hidden (internally "deleted") studies.