Description
onLaunchedWithItems
is implemented by passing fields through the querystring with an item.
prefix. The query params are set here and read here. The way it is currently implemented - on both sides - has property duplication which makes this code prone to missing information about these items.
One way we can fix the property duplication is by using iteration from a single source for fsitem properties. We don't have any sort of model/DTO/schema getter endpoint on backend though, so this still requires duplicating the property list on frontend or implementing this model getter. Another option is to iterate over the fsitem properties on send-side and then iterate over item.
query params in receive side which avoids this added complexity and should work fine. However, filesystem items are not constrained to 2048 characters while URLs are, and even half that or less might become an issue for apps with other open args; copying all the file item information through the URL therefore might be a bad idea.
My suggested solution is to only pass the file UUID to apps after granting the app permission to access the file (a user-to-app
permission) though the current permission system (rather than using the /sign
endpoint). onLaunchedWithItems
will then fetch the file information via puter.js the same way everything else does.