Skip to content

Conversation

@GeneralGDA
Copy link
Contributor

This pull request improves the handling and testing of server URLs in the application settings. The main focus is on ensuring that trailing slashes are consistently removed from server URLs before storing them, and updating the corresponding tests to verify this behavior.

Settings logic improvements:

  • Updated the setServerUrl method in settings.ts to remove any trailing slashes from the provided serverUrl before storing it, ensuring consistent URL formatting.

Test enhancements:

  • Modified the setServerUrl tests in settings.test.ts to use parameterized tests (test.each) with various forms of server URLs containing trailing slashes, verifying that the stored URL is always normalized.

Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
@GeneralGDA GeneralGDA marked this pull request as draft October 14, 2025 03:37
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
@GeneralGDA GeneralGDA marked this pull request as ready for review October 14, 2025 04:06
@GeneralGDA GeneralGDA requested a review from Copilot October 14, 2025 04:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves server URL handling by implementing consistent sanitization to remove trailing slashes from URLs before storage. This ensures that URLs are consistently formatted regardless of how they're input.

  • Refactored URL reading logic to apply sanitization to all URL sources including existing saved URLs
  • Added URL sanitization functionality that removes trailing slashes using a while loop
  • Enhanced test coverage with parameterized tests to verify trailing slash removal behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
desktop/src/main/settings.ts Added URL sanitization logic and refactored URL reading to consistently apply sanitization
desktop/src/test/main/settings.test.ts Updated tests to use parameterized approach testing various trailing slash scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@GeneralGDA GeneralGDA merged commit 925f644 into develop Oct 14, 2025
15 checks passed
@GeneralGDA GeneralGDA deleted the fix-desktop-app-server-url-argument-sanitizing branch October 14, 2025 04:40
@huly-github-staging
Copy link

Connected to Huly®: UBERF-13931

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.

4 participants