Skip to content

Cleanup lynx feature state subscriptions#3900

Open
RaymondLuong3 wants to merge 1 commit into
masterfrom
task/cleanup-lynx-subscription
Open

Cleanup lynx feature state subscriptions#3900
RaymondLuong3 wants to merge 1 commit into
masterfrom
task/cleanup-lynx-subscription

Conversation

@RaymondLuong3
Copy link
Copy Markdown
Collaborator

@RaymondLuong3 RaymondLuong3 commented May 22, 2026

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 Reviewable

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.90%. Comparing base (12f0d90) to head (7bb839a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3900   +/-   ##
=======================================
  Coverage   80.90%   80.90%           
=======================================
  Files         630      630           
  Lines       40677    40677           
  Branches     6578     6600   +22     
=======================================
  Hits        32909    32909           
+ Misses       6741     6728   -13     
- Partials     1027     1040   +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pmachapman pmachapman self-requested a review May 24, 2026 20:40
@pmachapman pmachapman self-assigned this May 24, 2026
Copy link
Copy Markdown
Collaborator

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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(() => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants