Skip to content

Fix duplicated condition in accessibility signal property change detection - #303604

Merged
Megan Rogge (meganrogge) merged 1 commit into
microsoft:mainfrom
ShehabSherif0:fix/accessibility-signals-duplicated-condition
Nov 5, 2026
Merged

Megan Rogge (meganrogge) merged 1 commit into
microsoft:mainfrom
ShehabSherif0:fix/accessibility-signals-duplicated-condition

Conversation

@ShehabSherif0

Copy link
Copy Markdown
Contributor

Fixes #303602

The condition on line 152 checked lastValueAtPosition !== undefined twice instead of also checking lastValueOnLine !== undefined. This guard is meant to skip the initial autorun call when both values are still undefined. Because only one variable was checked, the guard did not properly protect against lastValueOnLine being undefined.

Before: if (lastValueAtPosition !== undefined && lastValueAtPosition !== undefined)
After: if (lastValueAtPosition !== undefined && lastValueOnLine !== undefined)

…ction

The condition checked lastValueAtPosition twice instead of also checking
lastValueOnLine. This meant on the first autorun call, if
lastValueAtPosition happened to be set but lastValueOnLine was still
undefined, the signal triggers could fire prematurely.
Copilot AI review requested due to automatic review settings March 20, 2026 19:58
@vs-code-engineering vs-code-engineering Bot added this to the 1.113.0 milestone Mar 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes an initialization guard in the accessibility signal change-detection autorun within the editor text property signals contribution, ensuring both cached values are checked before firing transition-based signals.

Changes:

  • Corrected the guard condition to check lastValueOnLine !== undefined (instead of checking lastValueAtPosition twice), preventing lastValueOnLine from being treated as initialized when it isn’t.

@meganrogge Megan Rogge (meganrogge) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fix!

@meganrogge
Megan Rogge (meganrogge) enabled auto-merge (squash) November 3, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the initialization-guard correction.

No open issues 🎉

Review effort: Max

@meganrogge
Megan Rogge (meganrogge) merged commit 85ee95e into microsoft:main Nov 5, 2026
62 of 64 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated condition in accessibility signal property change detection - lastValueOnLine never checked

6 participants