Skip to content

Conversation

@MTarek165
Copy link
Contributor

@MTarek165 MTarek165 commented Dec 20, 2025

closes #13740

Description

  • UNC path problem occur during file path normalization because Path.of() is OS dependent for ex:
    when passing Path.of("/file.txt") to normalize at windows it becomes "\file.txt" entering the second check as it will consider it not starting with "/" returning "/\file.txt" causing UNC problem as it expects a correct UNC path not interpreted as file path

Solution

  • we must convert windows style to unix style before checks as checks assumes unix style

Testing

  • added test for both unix and windows styles and assert on their logical paths to ensure they are working on all environments
  • it tests normalization by simulating running on both by passing the formats produced from windows and unix styles and should normalize them correctly ( although that is sufficient, for more certainty it also passes locally on my windows machine and on CI (Linux) )

Notes

  • now this fixes many of failing tests related to files if running on windows since all depends on normalize()
  • there is redundant checks ( third check ) at normalize() as always we consider leadingBackSlash is true so keeping these checks and flag adding complexity only, instead WindowsUtils.windowsToUnixPath(String path) handle the issue with adding leading back slash as it is always the case
  • on the long term, it may be better to depend on unified logical path using String to avoid these OS issues because Path object depends on the OS which may make problems as the path format isn't unified

@MilosPaunovic MilosPaunovic added area/backend Needs backend code changes kind/external Pull requests raised by community contributors labels Dec 22, 2025
@MTarek165 MTarek165 changed the title Fix/os incompitibility file path problem fix(core): os incompitibility file path problem Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend Needs backend code changes kind/external Pull requests raised by community contributors

Projects

Status: To review

Development

Successfully merging this pull request may close these issues.

Namespace files cannot be used in Windows.

2 participants