Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(auto-edit): fix the false notification for auto-edit non eligibility #6899

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

hitesh-1997
Copy link
Contributor

@hitesh-1997 hitesh-1997 commented Jan 31, 2025

Context

This PR fixes an issue where users would receive a non-eligibility notification for auto-edits even when they were in the experiment flag and it is enabled for them. This happens because of the flaky network issue, and although we get error while evaluating the feature flag, we return false by default. This creates noisy alerts for the users.

image

To address this, I added a check that ensures the user is likely viewing the settings editor (either the JSON settings file or the graphical Settings UI) before displaying the non-eligibility notification.

Test plan

  1. Limit the networks bandwidth using charles proxy.
  2. Switch to the non pro account or override the feature flag cody-autoedit-experiment-enabled-flag to false.
  3. You should only get notification if either settings.json or the settings UI is open

@hitesh-1997 hitesh-1997 requested a review from umpox January 31, 2025 15:03
*
* This is because because of the flaky network issues we could evaluate the default feature flag value to false
* and show the non eligibility notification to the user even if they have access to the feature.
* Generally the users should see the notification only when they manully change the vscode config which could be either
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Generally the users should see the notification only when they manully change the vscode config which could be either
* Generally the users should see the notification only when they manually change the vscode config which could be either

nit :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

*
* @returns {boolean} True if the user is most likely viewing the Settings editor (JSON or UI), false otherwise.
*/
function isSettingsEditorOpen(): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting idea

@hitesh-1997 hitesh-1997 merged commit 4ca3877 into main Jan 31, 2025
21 checks passed
@hitesh-1997 hitesh-1997 deleted the hitesh/fix-auto-edit-notif branch January 31, 2025 15:22
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.

2 participants