Skip to content

Conversation

priya-patel04
Copy link
Collaborator

@priya-patel04 priya-patel04 commented Oct 15, 2025

Description

This PR focuses on creating a new RDP service for RDP client launch in DC feature, that helps keep the RDP client detection and launch, and setting user's preferred client logic centralized for reusability in components and controllers.

For more context, refer RDP service section of RFC.

🎟️ Jira ticket

Screenshots (if appropriate)

How to Test

Checklist

  • I have added before and after screenshots for UI changes
  • I have added JSON response output for API changes
  • I have added steps to reproduce and test for bug fixes in the description
  • I have commented on my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a11y-tests label to run a11y audit tests if needed

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've documented the impact of any changes to security controls.
    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

Copy link

vercel bot commented Oct 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
boundary-ui Ready Ready Preview Comment Oct 16, 2025 4:31pm
boundary-ui-desktop Ready Ready Preview Comment Oct 16, 2025 4:31pm

/**
* Returns the available RDP clients
*/
handle('getRdpClients', async () => []);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All the below four handlers are placeholders only. Logic will be added in a separate IPC handler PR

@priya-patel04 priya-patel04 marked this pull request as ready for review October 16, 2025 02:49
@priya-patel04 priya-patel04 requested a review from a team as a code owner October 16, 2025 02:49
@priya-patel04 priya-patel04 self-assigned this Oct 16, 2025
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these unit tests useful? It seems like we're mocking what is being returned and then verify that our mocks are being returned and not actual logic being tested.

Copy link
Collaborator Author

@priya-patel04 priya-patel04 Oct 20, 2025

Choose a reason for hiding this comment

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

Good point. Yeah it does just check the mocked data is returned correctly. I will update the tests

* The preferred RDP client set by the user.
* @type {string|null}
*/
@tracked _preferredRdpClient = null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use private fields for this if they're meant to be internal

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ahh yes thanks! I will update it

return this.preferredRdpClient && this.preferredRdpClient !== 'none';
}

get rdpClients() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these getters necessary? It seems users should just call the underlying function e.g. getRdpClients rather than a getter that actually is async but doesn't make it obvious to the consumer that it's async

this._rdpClients = await this.ipc.invoke('getRdpClients');
return this._rdpClients;
} catch (error) {
console.error('Failed to fetch RDP clients:', error);
Copy link
Collaborator

@ZedLi ZedLi Oct 17, 2025

Choose a reason for hiding this comment

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

We normally should log these instead (though they may already be being logged in the handle?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was wondering the same thing too. Maybe electron-log would be a good fit here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

May be we can keep logging in the handlers only and remove them from the service.

* the proxy details and constructs the appropriate RDP connection parameters.
* @param {string} session_id - The ID of the active session
*/
async launchRdpClient(session_id) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
async launchRdpClient(session_id) {
async launchRdpClient(sessionId) {

We normally use camelCase for standard JS that's not JSON from an API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants