Cleanup lynx feature state subscriptions#3900
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3900 +/- ##
=======================================
Coverage 80.90% 80.90%
=======================================
Files 630 630
Lines 40677 40677
Branches 6602 6595 -7
=======================================
Hits 32908 32908
+ Misses 6742 6729 -13
- Partials 1027 1040 +13 ☔ View full report in Codecov by Sentry. |
pmachapman
left a comment
There was a problem hiding this comment.
@pmachapman reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on RaymondLuong3).
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts line 842 at r1 (raw file):
this.setupTranslationEngine(); this.projectDataChangesSub?.unsubscribe(); this.projectDoc.remoteChanges$.subscribe(() => {
Just checking if this was a deliberate omission?
this.projectDataChangesSub = this.projectDoc.remoteChanges$.subscribe(() => {
Code quote:
this.projectDoc.remoteChanges$.subscribe(() => {
RaymondLuong3
left a comment
There was a problem hiding this comment.
@RaymondLuong3 made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on pmachapman).
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts line 842 at r1 (raw file):
Previously, pmachapman (Peter Chapman) wrote…
Just checking if this was a deliberate omission?
this.projectDataChangesSub = this.projectDoc.remoteChanges$.subscribe(() => {
No that was not. Nice catch!
7bb839a to
de88c37
Compare
pmachapman
left a comment
There was a problem hiding this comment.
@pmachapman reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on RaymondLuong3).
de88c37 to
e9b44bd
Compare
The subscription to the lynx state was being triggered every time the editor changed such as navigating to a new chapter. The result was that unnecessary subscriptions were being triggered and never unsubscribed. You can see this if you open the console in dev tools and try navigating between chapters. The warning "Max EventListeners exceeded" appears.
This change is