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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store token persistently, emit complete event on reconnect (if upload is complete) #264

Closed
arturi opened this issue Jul 20, 2017 · 13 comments
Assignees
Labels
Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3)

Comments

@arturi
Copy link
Contributor

arturi commented Jul 20, 2017

Discussed briefly in the call, could continue here 馃憣

@arturi arturi added the Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3) label Jul 20, 2017
@ifedapoolarewaju
Copy link
Contributor

@arturi for how long do you imagine this token be stored? To minimize the requirements (in terms of storage etc), I imagine it could be stored in session, and it would hence, disappeared when the session is expired. Does this work for the desired feature?

@arturi
Copy link
Contributor Author

arturi commented Jul 23, 2017

Yeah, thinking. How long would that session last approximately? Wasn鈥檛 able to quickly find a cookie to check. We are using https://www.npmjs.com/package/express-session and RedisStore, right?

@arturi
Copy link
Contributor Author

arturi commented Jul 23, 2017

cookie.expires
Specifies the Date object to be the value for the Expires Set-Cookie attribute. By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting a web browser application.

@ifedapoolarewaju
Copy link
Contributor

How long the session lasts can be configurable by any uppy-server user. Even though not yet implemented, the standalone server would pick up the session expiry time from environment variables.

Ideally uppy-server is not concerned with setting up the sessions, it is only dependent on it. If a user uses uppy-server as a pluggable app for example, (s)he would be in total control of the server sessions and is free to set it up however desired.

@arturi
Copy link
Contributor Author

arturi commented Jul 23, 2017

Yeah, makes sense. However for this RestoreFiles feature #268 I鈥檇 like the restore functionality to work for around 24 hours. Something like that.

Let鈥檚 also ask what @goto-bus-stop and @Acconut think :)

@goto-bus-stop
Copy link
Contributor

Agree, I was thinking of something between 4 hours and 24 hours.

@ifedapoolarewaju
Copy link
Contributor

ok, I think that can still be within the set lifetime of the session.

@Acconut
Copy link
Member

Acconut commented Jul 26, 2017

I鈥檇 like the restore functionality to work for around 24 hours.

24hrs is a good duration, out of my head. I would consider anything below half a day too low for some edge cases :)

@ifedapoolarewaju
Copy link
Contributor

@arturi I have added this feature to uppy-server. Now if you try to reconnect to the uppy server with a socket token for which an upload has been initiated, it would either continue with feeding upload progress (if upload is still on), or give a success or failure status.

The golden retriever branch doesn't seem to work with this feature out of the box. It seems it doesn't save the token on the client side yet. So instead it requests for a new token when the tab is closed and re-opened, hence, restarting the upload.

@ifedapoolarewaju
Copy link
Contributor

ifedapoolarewaju commented Jul 28, 2017

while trying make uppy client support this feature, I noticed a race condition in my server implementation when multiple files are uploading at once. I am going to try to fix that

@ifedapoolarewaju
Copy link
Contributor

I guess we might not be able to store the data in session after all

@ifedapoolarewaju
Copy link
Contributor

I have fixed this issue

@arturi
Copy link
Contributor Author

arturi commented Aug 4, 2017

馃帀

@arturi arturi closed this as completed Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Companion The auth server (for Instagram, GDrive, etc) and upload proxy (for S3)
Projects
None yet
Development

No branches or pull requests

4 participants