-
Notifications
You must be signed in to change notification settings - Fork 53
Studio Sync: Implement resumable uploads for sync archives #2167
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
Studio Sync: Implement resumable uploads for sync archives #2167
Conversation
📊 Performance Test ResultsComparing 4823c56 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change |
| @@ -1,8 +1,17 @@ | |||
| import * as Sentry from '@sentry/electron/renderer'; | |||
| // @ts-expect-error - Uppy types require newer moduleResolution, but types exist at runtime | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to look into how we can resolve this typescript error. The tests are also failing because of this.
2a6fddf to
1a68a50
Compare
|
@gavande1 thanks for taking the spike into the implementation. I haven't had a chance to test and review PR yet, but I wanted to share some thoughts on the UX. Currently, it supports automatic resuming when an internet connection is lost. It's a valid use case, and it's the most common. I'm curious how close the Tus brings us to adding more, e.g.:
Also, should we at least include the last one in this PR? Or would you treat this PR as a technology change that transparently handles temporary broken connections, and then work on UX improvements separately? |
The point of that change was to speed up uploads. Even if we adopt a new technical strategy with this PR that may bring performance benefits in and of itself, it remains true that uploading the archive from the renderer process adds significant overhead since the entire archive must be stored in memory (currently a maximum of 2GB, soon to be 5GB). I suggest researching ways to keep the upload running in the node process and to read the file as a stream, instead of storing the archive contents in memory. The uppy events ( If uppy doesn't support uploading streams directly, then the tus-js-client library (which uppy wraps) appears to do so (see API docs). |
|
Thanks @wojtekn and @fredrikekelund for looking at the PR.
It's already there. We just need to implement in our workflows.
Again, the capability is already there. We need to keep track of files being uploaded when closing the app and re-upload them after app restarts. We may need to add more logic for validity of archive.
It's very simple to add that. I think your suggestion to reflect connection issue in UI makes sense. I will add that.
I agree that uploading the archive from the renderer process adds significant overhead. However, I see that overhead as temporary. You are correct that Uppy does not support streaming uploads, and I explored using That said, I am absolutely open to switching to the Node process if you feel these reasons aren’t strong enough. Just let me know and I am happy to adjust the approach. |
|
In my previous testing (#1972 (comment)), uploading from the node process yielded more than 7x improvement in the upload time. The bigger the archive, the bigger the impact. Resumable uploads are a great way to increase reliability (and a great feature in and of itself). Still, users won't be happier if it comes at the price of slower uploads or a big increase in memory consumption. |
|
Thanks @fredrikekelund for sharing the improvements history. I am digging deeper into implementing it using file streams in the Node process. |
|
@fredrikekelund I have opened a new PR: #2212 to handle file uploads in the Node process. I will close this PR in favor of the new one. The updated PR also includes the suggestion from @wojtekn to display an indication when the upload is paused due to a network error. |
Related issues
Proposed Changes
/studio-app/sync/importnetwork request from node process #1972 as uploading happens in frontend.Testing Instructions
git checkout branch -- filenamesfor applying changes from two branches.public-api.wordpress.comand make it inFULL ACCESSmode.npm install & install startCleanShot.2025-12-02.at.18.44.24.mp4
Additional checks:
Pre-merge Checklist