-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Markdown: merge uploaded files callback #5980
Markdown: merge uploaded files callback #5980
Conversation
… (by creating new empty dictionary) in js. Introduces "bug" where file entries in js keeps growing. To be fixed in the next commit.
…eleting of the file entry is bound to the lifetime of the c# FileEntry instance. When garbage collecting the instance, the entry is deleted from js. This ensures synchronization of existing (reachable) objects between c# and js. This commit extends the IFileEntryOwner.cs to keep the fileEntry deleting logic out of the interface implementations (FileEdit and Markdown)
…o one call to .net. Same on the .net side.
@tesar-tech, the name of your branch indicates 1.7, but you're targeting |
file.FileUploadEndedCallback.SetResult(); | ||
} | ||
|
||
foreach ( var file in fileEntries ) |
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.
This seems to be working fine on my side. Not sure if there will be any sideefects now with your solution so please check.
Also, the finalizer was never reached for me in debug mode. Maybe we don't need it anymore?
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.
It is working, until user code hits the #5977 sub-issue 2. If we can live with that than the finalizer isn't needed...
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 never meant to support that anyway. The file should be handled asap during the changed event.
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.
Yes, that's why I suggested the rename and the api change to TryWriteToStreamAsync
, so users don't shoot their own leg with our "shoulds".
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.
Nah :)
OK, please remove finalizers from final versions. And add release notes before I merge it.
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.
Ok.
You mean release notes here #5857 or creating a release note 175 .razor?
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.
Ah, sorry, I didn't notice you have changed branch. Skip release notes, then. I will do that.
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.
It is working, until user code hits the #5977 sub-issue 2. If we can live with that than the finalizer isn't needed...
I should have done more tests. It seems we have now broken FilePicker. And FIlePicker works by saving references for later upload. So, I think we will need to go back to the finalizer or find an alternative for
foreach ( var file in files )
{
await file.Owner.RemoveFileEntry( file.Id );
}
Description
Closes #5977
ImageUploadChanged
. This is done by waiting for theimageUploadFunction
in js for 100ms.FileEdit
. Implementation leverages the finalizer ofFileEntry
object. (the sub-issue 2)Debug.WriteLine
to safe js calling as otherwise it often silences an important exceptions.