Skip to content
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

remove cancellation of coroutine children #715

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

rymorale
Copy link
Contributor

@rymorale rymorale commented Sep 26, 2024

Description

the coroutine children cancellation was causing all other coroutines other than the first to be cancelled early. this led to some race condition like behavior when determining if a presentable conflict had occurred. removing the children cancellation should have no effect on the event handling done in the DefaultInAppMessageEventHandler.
@prudrabhat did more in-depth investigation and his findings were:

Earlier, each presentable was using its scope that was too heavy. Calling cancel all children of the scope made sense when it was in its own scope. Now all the UI Service is using the same scope. When 2 or more in-app message show's are requested, web-view of the first in-app message is loaded, canceling everything in the scope will also cancel other show coroutine calls causing the other show calls not to reach this block!
I think this issue arised when I switched to use a single scope for all of the UIService.
I don't think we need the cancel all children now, as everything is dispatched on main using the same scope.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

the coroutine children cancellation was causing all other coroutines other than the first to be cancelled early. this led to some race condition like behavior when determining if a presentable conflict had occurred. removing the children cancellation should have no effect on the event handling done in the `DefaultInAppMessageEventHandler`.
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.62%. Comparing base (1f12c3d) to head (2f148fc).
Report is 3 commits behind head on dev.

Additional details and impacted files
@@              Coverage Diff              @@
##                dev     #715       +/-   ##
=============================================
+ Coverage     69.28%   81.62%   +12.33%     
- Complexity     1952     2151      +199     
=============================================
  Files           192      192               
  Lines          8982     8981        -1     
  Branches       1125     1125               
=============================================
+ Hits           6223     7330     +1107     
+ Misses         2293     1093     -1200     
- Partials        466      558       +92     
Flag Coverage Δ
functional-tests 27.83% <ø> (?)
unit-tests 69.22% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ices/ui/message/DefaultInAppMessageEventHandler.kt 78.57% <ø> (-0.30%) ⬇️

... and 38 files with indirect coverage changes

@rymorale rymorale merged commit a0687ff into adobe:dev Sep 27, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants