Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crashes if id does not exist/data is desynched with user database #170

Open
LDSamson opened this issue Feb 26, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@LDSamson
Copy link
Collaborator

LDSamson commented Feb 26, 2025

Creating a data.frame here will fail if the list of ids is NULL, causing the application to crash:

clinsight/R/shiny.R

Lines 2 to 6 in 7026387

with(val, data.frame(
id = unlist(ids),
reviewed = ifelse(isTRUE(review), "Yes", ifelse(isFALSE(review), "No", NA_character_)),
row_id = row_id
))

replacing it with id = unlist(ids) %||% NA_integer would solve it here, but then it will error further downstream in mod_review_forms because ids are missing (when using dplyr::rows_update).

This occurs when you update the metadata, merge it again with data, but forget to update the application database.
@jthompson-arcus this is of course a result of the bigger issue that this desynched state is possible in the first place See this #114.

Probably good to (in order of importance):

  1. better ensure that database is always up to date with the study_data
  2. make the app more robust if this is not the case/give a helpful error message
@LDSamson LDSamson added the bug Something isn't working label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant