codota / tabnine-vscode

Visual Studio Code client for Tabnine. https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode
https://www.tabnine.com/install/vscodeֿ
MIT License
1.35k stars 171 forks source link

Check access token before firing auth change event #1429

Closed msujew closed 3 weeks ago

msujew commented 4 months ago

I've recently noticed an issue with the tabnine extension in Eclipse Theia, see https://github.com/eclipse-theia/theia/issues/13336. I've tracked the issue down to a call to getState, which incorrectly fires the auth session change event, even though no login information has changed (some other, state related information changed, but the auth info was the same). I couldn't figure out why the extension behaves differently in vscode vs Theia, since both send the exact same events to the extension.

Instead, this change prevents the session change event from firing in case the access token didn't change. I've confirmed that this fixes the issue in Theia and as far as I could tell doesn't introduce any regression in vscode.

msujew commented 3 months ago

@dimacodota Any chance for a review?

JonasHelming commented 1 month ago

This fix would be really great to have!

dimacodota commented 3 weeks ago

will be released in the upcoming release