Skip to content

onLaunchedWithItems is prone to losing information about fsentries #1226

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

Open
KernelDeimos opened this issue Mar 27, 2025 · 1 comment · May be fixed by #1230
Open

onLaunchedWithItems is prone to losing information about fsentries #1226

KernelDeimos opened this issue Mar 27, 2025 · 1 comment · May be fixed by #1230
Labels
bug Something isn't working

Comments

@KernelDeimos
Copy link
Contributor

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.

@KernelDeimos KernelDeimos added bug Something isn't working good-ai-issue Good issue for AI to tackle labels Mar 27, 2025
KernelDeimos added a commit that referenced this issue Mar 27, 2025
- Modified launch_app.js to only pass file UUID to apps\n- Updated UI.js to fetch complete file information using puter.fs.stat()\n- Ensures consistent file information and avoids URL length limitations\n\nFixes #1226

ai: true
@KernelDeimos
Copy link
Contributor Author

Partly fixed with mycoder by #1230 except it doesn't use /sign (causing a regression) and doesn't grant permission (causing it to not work at all). Attempts to fix this by further prompting is resulting in relentless 429 errors from Claude (thanks Claude) so this will likely need to completed manually.

@KernelDeimos KernelDeimos removed the good-ai-issue Good issue for AI to tackle label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant