-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
Push to promises Missing semicolon A few more missing semicolons.
Hi Aaron! Thanks for the patch and sorry for the delay in response. Two things:
|
Yes, I agree with your recommendation. We will need to gate the initial batch upload in the function passed to retriableAction. That will allow better control over the fail/ok messages, which now need to have more knowledge of whether the action failed completely, partially succeeded (which is new), or completely succeeded. That will allow multiple rounds of failures, terminating when the user gives up, or all original files are uploaded. As an update, I'm on this. Should be done in the next couple days. |
Ok, I put together a solution to retry handling. The solution manages the user messages via the response passed to the deferred's resolve/reject method. This allows the messages to provide information based on the number of files successfully/unsuccessfully uploaded. By clicking 'Retry' the user is then able to attempt to upload the files that failed (unless they all the toast to time out). I do have a couple thoughts/questions in regards to this: First, the retriable action is intended to be idempotent, which is compromised if they can leave six files uploaded out of twelve total, say. Granted they can keep attempting to upload files until they give up, but there is no guarantee that all files will be uploaded. Technically, the same set of inputs could lead to a different output. We could enforce a strict requirement that all original files must be uploaded successfully to be stored, but that seems overly strict. Do we want to loosen the idempotence requirement on retriable action or add a new function that reflects the wider array of possibilities with batch operations. A second thought: file sizes will vary, potentially significantly. It could be useful to have a simple heuristic that groups files within a batch together to handle this. For example, if we had ten ~4MB files, one 500MB, and one 1GB file, we could send the "Uploaded X files, Y files failed" message per tier, rather than for the entire group. Final thought: I noticed that the $mdToast doesn't seem to be able to reach the fail state (unless I am missing something). It can timeout or it can be dismissed via user action, but I am not sure how it can fail. I found this issue which indicates that promise response is I'm happy to help with all of the above items now, or in a later PR. I want to get your opinions before moving forward on them. I'm enjoying working on this! |
Hi Aaron! (Sorry for delayed response; my day job's been busy.) My thinking at the moment is that the toast is probably too limiting for exactly the reasons you mention (and doesn't show progress, as mentioned in #6). What would be ideal to have is an operations dialog, a la Google Drive or Cloud Console, that shows progress of all in-flight files. What I'm seeing as the steps for this (ideally, each would be a separate pull for easier review):
Do you agree with this approach? Would you be willing to tackle this? |
Hi Ross, No worries on any delays! I agree with the approach. I am happy to work on this, but I will probably not have much of a chance to work on it until mid-October. If that's alright, then I'm on it! |
SGTM. I might pick off some of the smaller parts in the meantime as I get time. No worries on timeframe. :) |
I am going to close this one as I believe this functionality will fall out of the UploadManager quite nicely. |
I noticed the open issue, and figured I would take a crack at it since I would like to have this functionality. Also haven't used angular in a little while, so figured I would brush up on the docs.
Thanks for putting together such a slick interface! Let me know if there is anything I can do to improve the PR.