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

Future additions will break outdated app versions #564

Closed
hig-dev opened this issue Jan 17, 2024 · 0 comments · Fixed by #580
Closed

Future additions will break outdated app versions #564

hig-dev opened this issue Jan 17, 2024 · 0 comments · Fixed by #580

Comments

@hig-dev
Copy link
Contributor

hig-dev commented Jan 17, 2024

When going to the study selection screen, the app loads and deserializes all studies with open participation. The code in the app for the deserialization will fail if it encounters a new unknown type that was added in a new update. E.g. the FreeTextQuestion that will be added with #545.

Here is a list of the problematic lines that I could find:

factory Observation.fromJson(Map<String, dynamic> data) => taskTypes[data[Task.keyType]]!(data);

throw ArgumentError('Type ${data[keyType]} not supported.');

factory ReportSection.fromJson(Map<String, dynamic> data) => sectionTypes[data[keyType]]!(data);

return studyResultTypes[data[keyType]]!(data);

factory InterventionTask.fromJson(Map<String, dynamic> data) => taskTypes[data[Task.keyType]]!(data);

return questionTypes[data[keyType]]!(data) as Question<V>;

factory Expression.fromJson(Map<String, dynamic> data) => expressionTypes[data[keyType]]!(data);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant