Skip to content

Conversation

@Krosovok
Copy link
Contributor

No description provided.

@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Dec 22, 2025

SLCORE-1896

@Krosovok Krosovok force-pushed the feature/vt/SLCORE-1896-show-message-request branch from 2ced92c to 65df6f4 Compare December 22, 2025 15:10
@Krosovok Krosovok marked this pull request as draft December 23, 2025 07:53

/**
* Display a message to the user, usually in a small notification.
* This message has options that user can pick from. Once user clicked on option, it's String key is returned.
Copy link
Contributor

Choose a reason for hiding this comment

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

'that user can pick' -> that the user can pick, or that users can pick
it's -> its

/**
* Display a message to the user, usually in a small notification.
* This message has options that user can pick from. Once user clicked on option, it's String key is returned.
* If the user explicitly dismisses/closes the notification without clicking option, then it returns null.
Copy link
Contributor

Choose a reason for hiding this comment

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

what returns null? Is it they key that should be null? Or the entire response? If it's the latter, I'm not sure we did that in the past, so far we always provided a response object, and manage different cases in the response object (e.g. some null fields). But it's probably fine to change this approach

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sophio mentioned in the refinement doc that for VSCode

If the user explicitly closes the notification, it will resolve with undefined value.

While I am not 100% sure if that means the whole response or just value, I am just coming from assuming the worst. Some Optional chaining will handle it easily anyway.

* Display a message to the user, usually in a small notification.
* This message has options that user can pick from. Once user clicked on option, it's String key is returned.
* If the user explicitly dismisses/closes the notification without clicking option, then it returns null.
* IMPORTANT: As user might not react to the notification at all, the returned future might block for an indefinite amount of time.
Copy link
Contributor

Choose a reason for hiding this comment

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

as user -> as users

* This message has options that user can pick from. Once user clicked on option, it's String key is returned.
* If the user explicitly dismisses/closes the notification without clicking option, then it returns null.
* IMPORTANT: As user might not react to the notification at all, the returned future might block for an indefinite amount of time.
* So caller should not block waiting for the result, but provide a callback instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

caller -> the caller

I'm not sure I understand the advice, but it's fine, future callers will check the implementation to come

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically it means that it shouldn't be called from any thread that is supposed to handle anything else (like SLCore initialization for instance). As we are going to schedule it anyway it doesn't matter this time but I just wanted to make sure that people will not freeze SLCore by waiting for a user action.

@Krosovok Krosovok force-pushed the feature/vt/SLCORE-1896-show-message-request branch from 65df6f4 to 2ad1f7c Compare December 23, 2025 11:11
@Krosovok Krosovok changed the title SLCORE-1896 Introduce showMessageRequest method SLCORE-1901 SLCORE-1895 SLCORE-1896 Introduce in-app notification for asking feedback Dec 23, 2025
@sonarqube-next
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
4 New issues

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

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