-
Notifications
You must be signed in to change notification settings - Fork 39
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
Update ⬆️ to newest Azure Storage SDK for file shares 🗂 #558
Conversation
const fileClient: azureStorageShare.ShareFileClient = createFileClient(root, shareName, directoryPath, name); | ||
let propertiesResult: azureStorageShare.FileGetPropertiesResponse = await fileClient.getProperties(); | ||
let options: azureStorageShare.FileCreateOptions = {}; | ||
options.fileHttpHeaders = {}; |
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.
So I missed the conversation when I was OOF on Thanksgiving on why we're doing it like this. If it's a limitation of the new sdk, I think we should file an issue because the old sdk handled this much better. Does the Storage Explorer team use this version of the sdk and do they do the same thing?
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.
We'd like to know what is missing from the new sdk. /cc @XiaoningLiu
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.
@jeremymeng It would be easier to update a file's contents while maintaining its metadata & properties if FileCreateOptions
and FileGetPropertiesResponse
had the same object structure. Either that or an update function that uploaded a file's new contents while preserving properties.
Today we have to read the existing properties/metadata and include them when updating a file via uploadFile
.
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.
@wwlorey agree. Thanks for the feedback! I logged an issue at Azure/azure-sdk-for-js#7097
}); | ||
}); | ||
// tslint:disable-next-line: no-unsafe-any | ||
let responseValue: azureStorageShare.DirectoryListFilesAndDirectoriesSegmentResponse = (await response.next()).value; |
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.
nit: Not sure I see the point in returning { files: azureStorageShare.FileItem[], directories: azureStorageShare.DirectoryItem[], continuationToken: string }
when you could just return DirectoryListFilesAndDirectoriesSegmentResponse
directly and it has all the same information
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 just liked saving segment.fileItems
as files
, etc. It seemed cleaner for functions that call listFilesInDirectory
to deal with
Fixes #328