-
Notifications
You must be signed in to change notification settings - Fork 13
Remove stored file size property from ChunkedFile #50
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
Conversation
daytime-em
left a comment
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 really love this idea! Maybe the rest of the code that relies on fileSize could also benefit from this approach
cjpillsbury
left a comment
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.
Added some thoughts.
0f668dd to
a66d667
Compare
|
Updated PR title and description so its more apparent what's changing vs not changing |
Store fileURL inside ChunkedFile when an active handle is available Simplify state checking inside ChunkedFile Prevent potential crash due to overflow Remove SIZE_UNKNOWN Keep a reference to FileManager for eventual dependency injection when initializing ChunkedFile
79d8f57 to
58042a1
Compare
daytime-em
left a comment
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.
LGTM I just had a question about swift practices
# Conflicts: # Sources/MuxUploadSDK/Upload/ChunkedFileUploader.swift
daytime-em
left a comment
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.
Thanks for the discussion!
f695635 to
1cd7591
Compare
|
Just force pushed because the new file wasn't picked up earlier, merging now. |
Store fileURL inside ChunkedFile when an active handle is available Simplify state checking inside ChunkedFile Prevent potential crash due to overflow Remove SIZE_UNKNOWN Keep a reference to FileManager for eventual dependency injection when initializing ChunkedFile Add extension method to work around Swift compiler buffoonery
Store fileURL inside ChunkedFile when an active handle is available Simplify state checking inside ChunkedFile Prevent potential crash due to overflow Remove SIZE_UNKNOWN Keep a reference to FileManager for eventual dependency injection when initializing ChunkedFile Add extension method to work around Swift compiler buffoonery
Store fileURL inside ChunkedFile when an active handle is available Simplify state checking inside ChunkedFile Prevent potential crash due to overflow Remove SIZE_UNKNOWN Keep a reference to FileManager for eventual dependency injection when initializing ChunkedFile Add extension method to work around Swift compiler buffoonery
Store fileURL inside ChunkedFile when an active handle is available Simplify state checking inside ChunkedFile Prevent potential crash due to overflow Remove SIZE_UNKNOWN Keep a reference to FileManager for eventual dependency injection when initializing ChunkedFile Add extension method to work around Swift compiler buffoonery
Currently the file size is stored in ChunkedFile, this happens as a side effect of opening the file. This PR removes the stored property and retrieves the file size from
FileManagerdirectly whenever it is needed. The intention of this change is to reduced duplicate state between the SDK andFileManageras well as reduce the number of possible state permutations the SDK can take on.