-
-
Notifications
You must be signed in to change notification settings - Fork 360
Fix to - Only one operation can be active at at time #598 #649
Conversation
changed the variable "completionSource" scope to public static, to access it from MediaPickerActivity
Following Scastria comment from the bug - jamesmontemagno#598 (comment) If we null out the completionsource on sleep, which will call OnDestry to the media Activity, it fixes the issue
@motoko89 - Here are the steps for this -
Now as soon as you click the hime button, destroy on the Media activity will get called as its not the Main activity in my case. Main activity is my App, where I am using the Media plugin, which has a MediaPickerActivity. |
There were a lot of changes in the multi-select gallery part, will need to resolve some conflicts or make a new PR here |
@jamesmontemagno |
Applied same changes for TaskCompletionSource<List<MediaFile>> completionSourceMulti;
We need to also null the completionSourceMulti.completionSource as we did for MediaImplementation.completionSource
@vagrawal1986 Do you think this fix would apply to the issues with clicking outside the popup in iOS (see #666)? It looks like the original author of the multi-select feature was seeing the same issue as me, but it seems he thought it was handled (#598 (comment)). |
@Trevonious |
Fixes # .
Changes Proposed in this pull request:
Following scastria comment -
#598 (comment)
"The cause is pretty simple. The media picker uses TaskCompletionSource to turn a callback driven API into Task async/await style. but the code adds a check to make sure that only 1 TaskCompletionSource is active at one time. "
"So whether you click the button twice or do my workflow, in both cases TaskCompletionSource is not null the second time and the exception is thrown."
If we null out the completionSource onDestry of the MediaPicker activity, we can get rid of the bug