Repository navigation
Conversation
Each model was created with a plain-text language selection, which subscribes it to the language service. A large comparison's ~430 models tripped the emitter's leak check, raised as uncaught errors at 200, 300 and 400 listeners. The models never change language, since diffr's decorations colour the code, so they now take plain text directly. Agent-Session: 429958d8-68f3-4f68-bd3b-a8371e7feb8e Agent-Session: 5eb4067a-b2f6-4508-a6dd-0471ff2c14d1
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Create diffr web's file models as plain text with no language selection, so they stop tripping the language service's leak check. Stacks on #1022; merge #1022 first. Independent of #1093–#1095.
languageService.createById(PLAINTEXT_LANGUAGE_ID). A language selection subscribes its model toLanguageService.onDidChange, so a large comparison (vitev5.3.0...v5.4.0, 217 files, ~430 models) crossed the emitter's leak threshold and raisedUncaught Error: potential listener LEAK detectedat 200, 300 and 400 listeners.createModel(text, null, uri)gives plain text without the subscription. These models never change language: diffr's decorations colour the code.Evidence
v5.3.0...v5.4.0with every file diffed: before, three leak warnings and three uncaught errors; after, no console warnings or errors. JS heap 116 MB after, 122–132 MB before.Merge Danger
Door: two-way; revert the commit.
Blast Radius: diffr web's desktop (Monaco) view. A model that relied on its language selection would lose language-based behaviour; these are plain text throughout.