Skip to content

Cleanup lynx feature state subscriptions#3900

Merged
pmachapman merged 1 commit into
masterfrom
task/cleanup-lynx-subscription
May 25, 2026
Merged

Cleanup lynx feature state subscriptions#3900
pmachapman merged 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 (7ced458) to head (e9b44bd).
✅ 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     6602     6595    -7     
=======================================
  Hits        32908    32908           
+ Misses       6742     6729   -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(() => {

Copy link
Copy Markdown
Collaborator Author

@RaymondLuong3 RaymondLuong3 left a comment

Choose a reason for hiding this comment

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

@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!

@RaymondLuong3 RaymondLuong3 force-pushed the task/cleanup-lynx-subscription branch from 7bb839a to de88c37 Compare May 25, 2026 15:56
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.

:lgtm:

@pmachapman reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on RaymondLuong3).

@pmachapman pmachapman force-pushed the task/cleanup-lynx-subscription branch from de88c37 to e9b44bd Compare May 25, 2026 20:22
@pmachapman pmachapman temporarily deployed to screenshot_diff May 25, 2026 20:27 — with GitHub Actions Inactive
@pmachapman pmachapman merged commit 3b286af into master May 25, 2026
26 checks passed
@pmachapman pmachapman deleted the task/cleanup-lynx-subscription branch May 25, 2026 20:42
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