Closed aud0201 closed 11 months ago
@dotnet-policy-service agree
Hi @aud0201
First thank you for making your first contribution, it is very appreciated.
Some review comments
I had a quick lock at this and came up with a slightly different solution. You can have a look at (feel free to take the code) https://github.com/OpenRIAServices/OpenRiaServices/compare/main...Daniel-Svensson:OpenRiaServices:throw_exceptions_on_syncContext
Do you know if the authentication logic has the same problem, it might also use FromCurrentSynchronizationContext`?
Would you be interested to also write an unit test ?
I belive a good test should
There are some tests for similar cases in OperationTests such as
@Daniel-Svensson
Thank you for your response. I will try implementing it based on the guidance you provided.
hi @Daniel-Svensson
Based on your suggestions, I have modified OperationBase.InvokeCompleteCallbacks and created a unit test.
As for unit tests, I haven't written many, so I'm not sure if I need to write more tests.
God job so far, I think this makes a god contribution and should make it into a new release without to much delay (probably 5.4.0)
As for unit tests, I haven't written many, so I'm not sure if I need to write more tests.
I will se if @SandstromErik has the time to review and think about tests.
Without thinking much about it it might be a good idea to update the 3 test methods
So that they also check that that the exception is thown on synronization context instead of the current approach
/azp run
No commit pushedDate could be found for PR 427 in repo OpenRIAServices/OpenRiaServices
/azp run /azp help
/azp run
No commit pushedDate could be found for PR 427 in repo OpenRIAServices/OpenRiaServices
@aud0201 I ran some additional tests on this (I tried to rewrite the test for "normal" unhandled exceptions to verify they work correctly with SyncronizationContext) and discovered that may proposed method did not handle that case).
I've fixed that scenario and updated those tests as well as added a note to the changelog.
If everything builds the changes should be merged soon. Thank you for your contribution
Kudos, SonarCloud Quality Gate passed!
Released to nuget as preview.2 , @aud0201 please try it out
It works! @Daniel-Svensson
This update solved a lot of headaches in my project migrating
I've learned a lot from this. thank you very much 👍
If completeTask ouccred an exception, throws an exception using GetAwatier().OnCompleted().
424