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

Add notification in SDK for uploaded files #353

Open
ValentaTomas opened this issue Apr 10, 2024 · 0 comments
Open

Add notification in SDK for uploaded files #353

ValentaTomas opened this issue Apr 10, 2024 · 0 comments
Labels

Comments

@ValentaTomas
Copy link
Member

ValentaTomas commented Apr 10, 2024

When you upload a file via URL on the frontend you have to manually call your backend if you want to react there to this event.

We could have a hook/callback in the SDK that automatically creates these sandbox-related notifications.

This hook could be either an instance or class method:

  1. As instance method — requiring you to have a sandbox connection:
sandbox.filesystem.onFileUpload((path) => {})

This could be implemented via watchDir functionality relatively easily.

  1. As a class method — this would allow you to have the hook without a sandbox connection:
Sandbox.onFileUpload(sandboxID, (path) => {})

Implementing this is noticeably harder — it would require us to have a notification system/infra and changes to the envd to allow forwarding events to this system.


The current solution is for example to call the server from the frontend after POSTing to the fileURL, or POSTing to the server and calling sandbox.uploadFile from there.

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

No branches or pull requests

1 participant