OdyseeTeam / odysee-api

API server for Odysee
https://odysee.com
MIT License
228 stars 49 forks source link

Publish: non-blocking `notify` alternative #401

Closed infinite-persistence closed 2 years ago

infinite-persistence commented 2 years ago

Issue

When uploading a large file (e.g. 3.5GB), after the TUS transfer has completed successfully, the notify call always timeout after 1.7 minutes. But the SDK call actually work -- if I wait long enough, I can see the transaction in the blockchain. Currently, the frontend retries notify 1 more time when there is an error, so we end up with either a file currently locked or a stat - not found.

We've also tried delaying the notify call for 5 minutes, thinking that perhaps the file is being copied or reconstructed after the TUS upload, but it has no effect -- the notify call will still end up with a 1.7 minute timeout.

This appears as a failure to the user, but behind the scenes the SDK call eventually passes. If the user re-uploads they end up with 2 claims.

Suggestion

Randy suggested that perhaps a non-blocking notify alternative can be used, and create another endpoint to check the status of SDK publish call.

Or take a look at what's causing the timeout for large files.

tzarebczan commented 2 years ago

@andybeletsky is this call behind Cloudflare that's why it's 1.7 min? Maybe can make notify on the V1 routing path.

Or do you have other ideas here? This was patched a bit on web side with a warning. Not sure how often it's happening now...