esmero / strawberryfield

A Field of strawberries
GNU Lesser General Public License v3.0
10 stars 5 forks source link

Add extra checks for as:filetype structure values if a user decides (still don't OK?) RAW edit JSON and remove keys #329

Open DiegoPino opened 2 months ago

DiegoPino commented 2 months ago

What?

We actually depend on a sane as:document, as:image etc internal structure. For checksumming, for sorting, etc. Of course archipelago will recreate it if you delete the whole thing and is very good at managing file related info. But there is a catch. If a user goes and edits/removes important keys from there, like the UUID, the parent Key where it is stored, the name! Then our code will fail.

An example from the wild that @alliomeria shared with me relates to "sorting" files when someone removed the "name" key

I can touch the current File Persister Service and be more thorough but I can't auto fix when people intentionally edit the JSON (the variations are infinite), so I will avoid the errors but generate a BIG/LARGE Log warning. Which also means: read your logs