Import of malformed character sheet .json possible
maxschlosser opened this issue Β· comments
π© Describe the bug
It is possible to import character JSON that is missing the id
field for at least one element.
The same applies to duplicate id
s.
I already talked to @lynn0702 on Discord, who told me that missing or duplicate id
will very likely lead to a broken UI and internal failures.
π’ Steps to reproduce
- Create a new character
- Import a template (e.g. Savage Worlds)
- Set a value
- Export the character to a JSON (
sheet.json
) - Delete the character
- Edit
sheet.json
, either
.. remove theid
field of some elements
.. edit twoid
fields to be the same - Create a new character
- Import the modified
sheet.json
- Export the imported character
Note: Steps 2 and 3 might not be necessary, but that is what I did.
π’ Expected behavior
I would expect one of two behaviors if id
s are missing or duplicate:
- The JSON is rejected with an error. An output on which field(s) caused the issue would be very useful but may not be feasible.
- The JSON is repaired with new unique ids.
π΄ Actual behavior
Fari accepts the import and generates what looks like a correctly formatted character sheet.
The id
s are still missing or malformed when the sheet is exported again.
π Screenshots
...
π₯ Desktop or Smartphone
- OS: Windows 11
- Browser: Firefox
π Additional context
Malformed Input:
If you can give me some pointers on where to start I could check if I can fix this myself. Looking for import
surprisingly didn't turn up anything useful π