-
Notifications
You must be signed in to change notification settings - Fork 194
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
Unable to load IFileVersion.Size property for items 2GB and greater #581
Comments
Nice catch @WillickDN , I've updated that property to also be a long. Please check our next nightly build for the update. Thanks for using PnP Core SDK and providing this feedback! |
Thanks for getting to this so quick! I pulled in the latest today, 1.4.16-nightly. I can see that the type of IFileVersion.Size is a now a long (confirmed in my testing). However, it still fails to load the property if the size of the versions content is greater than 2147483647 bytes. This line: PnP.Core.Services.BatchClient.ProcessSharePointRestBatchResponseContent(PnP.Core.Services.Batch, string) If I only request the files length for any size file, it will return the file.Length property no problem. Again, thanks for looking at it. If you need more information I can try and get it for you. |
Let me build a test case and see if I can repro/fix this @WillickDN |
@WillickDN : managed to repro and fix this. The issue was because the Size property on |
Awesome find! I will grab the next nightly and try again. Thank you! |
Grabbed the latest nightly and looks like the issue is taken care of. Thanks again for everything you are doing. Really appreciate it! |
Category
Describe the bug
For context, the IFile.Length is of type long and IFileVersion.Size if of type int. Both of them are supposed to return the size of the file (or its version) from Sharepoint. Any FileVersion that is larger than an int can hold won't load the .Size property and trying to load it will throw an exception.
Steps to reproduce
var listItem = await list.Items.GetByIdAsync(1, li => li.All, li => li.Versions.QueryProperties(v => v.All, v => v.FileVersion.QueryProperties(fv => fv.Size)), li => li.File);
//Can't be the current version, as that is just the IFile to handle content, not IFileVersion.
var version = listItem.Versions.AsRequested().FirstOrDefault(v => !v.IsCurrentVersion);
if (version != null) { var size = version.FileVersion.Size; Console.WriteLine($"Size in bytes is {size}"); }
{HttpResponseCode: 400
Code: System.InvalidOperationException
Message: Operation is not valid due to the current state of the object.
ClientRequestId:
} PnP.Core.BaseError {PnP.Core.SharePointRestError}
Expected behavior
Should be able to load the Size property of file versions that are larger than 2GB.
Environment details (development & target environment)
The text was updated successfully, but these errors were encountered: