-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
feat(runtime-html): deactivate while activating #1760
feat(runtime-html): deactivate while activating #1760
Conversation
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.
Nice one @Sayan751. This covers case where we are guaranteed to exit during a phase. Will it work when there' no such guarantee? Example is when there's a long running promise returned in attaching and deactivate is call while that promise is still running? If it doesn't do that, we probably cant supersede #1729.
packages/__tests__/3-runtime-html/controller.error-recovery.spec.ts
Outdated
Show resolved
Hide resolved
Good point @bigopon! I will add the tests. Thanks for the review. |
Yeah, I don't think this covers all use cases that #1729 covers. I'd be surprised if there's a so much easier way to solve those that it's worth searching for a different enough take than that in #1729. π€· |
No worries, thanks for the PR. Simplest case I can think of is attaching returns a promise that resolves in 100ms. Then a deactivate is called at 20ms. After that, there shouldn't be any attached hook invoked. |
66c882a
to
8ff8318
Compare
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.
Nice work @Sayan751 A few more details to iron out for the implementation then I'll start reviewing the test π
packages/__tests__/3-runtime-html/controller.deactivation.partially-activated.spec.ts
Outdated
Show resolved
Hide resolved
56c2bcd
to
2ed4911
Compare
Codecov Report
@@ Coverage Diff @@
## jwx-cancel-activation #1760 +/- ##
=========================================================
+ Coverage 87.84% 88.01% +0.17%
=========================================================
Files 242 242
Lines 22592 22555 -37
Branches 5177 5163 -14
=========================================================
+ Hits 19845 19852 +7
+ Misses 2747 2703 -44
... and 2 files with indirect coverage changes π£ Weβre building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Nice work on the tests @Sayan751 I have some minor comments for now, will continue soon. Currently I don't agree with the form of the tests, loops are still employed and I anticipate that it's not gonna help us move forward. I'll think of a way to remove the loop and propose that in a separate PR targeting this branch.
packages/__tests__/3-runtime-html/controller.deactivation.partially-activated.spec.ts
Outdated
Show resolved
Hide resolved
packages/__tests__/3-runtime-html/controller.deactivation.partially-activated.spec.ts
Show resolved
Hide resolved
packages/__tests__/3-runtime-html/controller.deactivation.partially-activated.spec.ts
Outdated
Show resolved
Hide resolved
packages/__tests__/3-runtime-html/controller.deactivation.partially-activated.spec.ts
Outdated
Show resolved
Hide resolved
@bigopon Thanks for the review. I think if we remove the loop, the test suite will explode in size and will soon be unmanageable. I have tried to keep the loop to minimum, not to create much cognitive load. |
β¦relia into topic/runtime/deactivate-while-activating
Pull Request
π Description
This should supersede the PR #1729.
π« Issues
π©βπ» Reviewer Notes
π Test Plan
β Next Steps