Skip to content

Conversation

@chrisduerr
Copy link
Member

@chrisduerr chrisduerr commented Nov 1, 2024

This fixes an issue with hints where it was possible that the terminal
content of highlighted hints changed between the highlighted hint update
and the activation of the hint.

This patch always validates the hint's text content against the hint
itself to ensure that the content is still valid for the original hint
which triggered the highlight.

Closes #8277.

@chrisduerr chrisduerr requested a review from kchibisov November 1, 2024 21:04
@chrisduerr chrisduerr changed the title Link invalidation Fix racing condition in hint triggering Nov 1, 2024
@chrisduerr
Copy link
Member Author

chrisduerr commented Nov 1, 2024

I've only tested that this doesn't break anything, since it's hard to verify the racing condition itself. But I'm pretty confident that should squash all possible issues.

I've also decided to call this in trigger_hint directly, even though some locations create the hint right before calling it. While this could technically be bad for performance, hint triggering happens very rarely and I think it's better to stay on the safe side and ensure this API can never be called incorrectly.

This fixes an issue with hints where it was possible that the terminal
content of highlighted hints changed between the highlighted hint update
and the activation of the hint.

This patch always validates the hint's text content against the hint
itself to ensure that the content is still valid for the original hint
which triggered the highlight.

Closes alacritty#8277.
@chrisduerr chrisduerr merged commit fd745a9 into alacritty:master Nov 2, 2024
@chrisduerr chrisduerr deleted the link_invalidation branch November 2, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Highlighted hints use old data for their actions

2 participants