It is possible to import character JSON that is missing the id field for at least one element.
The same applies to duplicate ids.
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 the id field of some elements
.. edit two id 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 ids 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 ids are still missing or malformed when the sheet is exported again.
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 😅
🚩 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 duplicateid
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
sheet.json
)sheet.json
, either .. remove theid
field of some elements .. edit twoid
fields to be the samesheet.json
🟢 Expected behavior
I would expect one of two behaviors if
id
s are missing or duplicate:🔴 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
📄 Additional context
Malformed Input: