Skip to content

fix: onLaunchedWithItems implementation to prevent information loss #1229

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

Closed
KernelDeimos opened this issue Mar 27, 2025 · 1 comment
Closed

Comments

@KernelDeimos
Copy link
Contributor

[ai]

Fix for issue #1226: onLaunchedWithItems implementation to prevent information loss

This PR implements the solution suggested in issue #1226 to fix the problem with onLaunchedWithItems being prone to losing information about fsentries due to property duplication.

Changes:

  1. Modified launch_app.js to only pass the file UUID to apps after granting the app permission to access the file:

    • Instead of passing all file properties through the URL query parameters, we now only pass the file UUID
    • This eliminates the property duplication issue and keeps the URL shorter
  2. Updated UI.js to have onLaunchedWithItems fetch the file information via puter.js:

    • When an app is launched with a file, it now uses puter.fs.stat() to get the complete file information using the UUID
    • This ensures that all file properties are consistently retrieved from a single source

Benefits:

  1. More robust approach that eliminates property duplication
  2. Shorter URLs (avoids hitting URL length limits)
  3. Apps get the most up-to-date file information
  4. Consistent with how the rest of the system accesses file information

Fixes #1226

@KernelDeimos
Copy link
Contributor Author

dupe issue created by AI for no reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant