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

Import of malformed character sheet .json possible #536

Open
maxschlosser opened this issue Feb 21, 2024 · 1 comment
Open

Import of malformed character sheet .json possible #536

maxschlosser opened this issue Feb 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@maxschlosser
Copy link

🚩 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 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

  1. Create a new character
  2. Import a template (e.g. Savage Worlds)
  3. Set a value
  4. Export the character to a JSON (sheet.json)
  5. Delete the character
  6. Edit sheet.json, either
    .. remove the id field of some elements
    .. edit two id fields to be the same
  7. Create a new character
  8. Import the modified sheet.json
  9. 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:

  1. 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.
  2. 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.

💅 Screenshots

...

🖥 Desktop or Smartphone

  • OS: Windows 11
  • Browser: Firefox

📄 Additional context

Malformed Input:

@maxschlosser maxschlosser added the bug Something isn't working label Feb 21, 2024
@maxschlosser maxschlosser changed the title JSON - Import of malformed characters possible Import of malformed character sheet .json possible Feb 21, 2024
@maxschlosser
Copy link
Author

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 😅

glmdgrielson added a commit to glmdgrielson/fari-app that referenced this issue Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants