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

Fixing event JSON mapping #382

Merged
merged 2 commits into from
Dec 19, 2021
Merged

Fixing event JSON mapping #382

merged 2 commits into from
Dec 19, 2021

Conversation

thomassth
Copy link
Contributor

Part of #320

Of course #321 only fixes internal JSON translations.

This fixes JSON translations between app and respective device OS.

@thomassth
Copy link
Contributor Author

It seems to be fine on Android

Not tested on iOS yet

Copy link
Contributor

@sowens-csd sowens-csd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably covered in some previous PR but why are we changing the names? What's the goal of the change?

@thomassth
Copy link
Contributor Author

It wasn't entirely fixed actually

A lot of event arguments have changed names some time ago, probably during the setup for timezones, and wasn't updated across the board. Ie. Currently the event title and other fields created by toJSON can't be read by fromJson. Reading and writing to devices were fine though since probably only toJSONwas edited.

I only discovered that when I merge the PR for testing.

I just realized that any JSON maps previously created will be unusable. Either we make toJSON able to read both of them or we need a mitigation.

@thomassth
Copy link
Contributor Author

thomassth commented Dec 19, 2021

This is where the trouble came from

aea3379#diff-9e474c05021706fff3750cb85b2d9a25f4d2d528b95c285bb1881cc5bfff03b9

Either we follow through or we need to revert.

@thomassth thomassth changed the title Renaming more variables Fixing event JSON mapping Dec 19, 2021
Copy link
Contributor

@sowens-csd sowens-csd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it on iOS and it seems fine. You said that any maps created previously will be unreadable, you mean anything that was persisted? Within the scope of a single session the values should be consistent now?

@thomassth
Copy link
Contributor Author

thomassth commented Dec 19, 2021

I tried it on iOS and it seems fine. You said that any maps created previously will be unreadable, you mean anything that was persisted? Within the scope of a single session the values should be consistent now?

Any Event JSONs created prior to 4.0 are unreadable after 4.0. If somebody store event JSONs and reuse them they are in big trouble.

4.0 and 4.0.1 will still create faulty JSONs because the conversion is incomplete. Said people are in moderate trouble.

In all cases, if you DON'T store these JSONs and only pass them between operations, 4.0 is faulty, 4.0.1 fixes the times of events, this PR should fix the rest.

We definitely need better testing procedures.

@thomassth thomassth merged commit 712c55d into builttoroam:develop Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants