Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

WebDAV servers return full URLs (e.g., http://server:80/root/path/file.txt) in PROPFIND responses, but GetRelativePath was only handling relative path strings, causing ListItemsAsync to fail.

Changes:

  • Modified GetRelativePath to detect and parse full URLs using Uri.TryCreate
  • Extract AbsolutePath component and URL-decode it before stripping root path
  • Preserves existing behavior for relative path inputs

Example:

// Before: Failed on full URLs
GetRelativePath("http://webdav:80/root/list_test/file1.txt")  
// Returned: "http://webdav:80/root/list_test/file1.txt" (wrong)

// After: Correctly extracts relative path
GetRelativePath("http://webdav:80/root/list_test/file1.txt")  
// Returns: "list_test/file1.txt" (correct)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 14, 2026 12:27
…ebDAV resource URLs

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 14, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 127.0.0.11
    • Triggering command: REDACTED, pid is -1 (packet block)
  • 8.8.8.8
    • Triggering command: REDACTED, pid is -1 (packet block)
  • analytics.localstack.cloud
    • Triggering command: /opt/code/localstack/.venv/bin/python /opt/code/localstack/.venv/bin/python -m localstack.runtime.main 172.18.0.4 --dport 21 -j MASQUERADE (dns block)
    • Triggering command: /opt/code/localstack/.venv/bin/python /opt/code/localstack/.venv/bin/python -m localstack.runtime.main es --no�� --noprofile (dns block)
  • api.localstack.cloud
    • Triggering command: /opt/code/localstack/.venv/bin/python /opt/code/localstack/.venv/bin/python -m localstack.runtime.main 172.18.0.4 --dport 21 -j MASQUERADE (dns block)
    • Triggering command: /opt/code/localstack/.venv/bin/python /opt/code/localstack/.venv/bin/python -m localstack.runtime.main es --no�� --noprofile (dns block)
  • assets.localstack.cloud
    • Triggering command: /opt/code/localstack/.venv/bin/python /opt/code/localstack/.venv/bin/python -m localstack.runtime.main 172.18.0.4 --dport 21 -j MASQUERADE (dns block)
    • Triggering command: /opt/code/localstack/.venv/bin/python /opt/code/localstack/.venv/bin/python -m localstack.runtime.main es --no�� --noprofile (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix CI issues and reconcile dev branch Fix WebDAV GetRelativePath to handle full URLs from server responses Jan 14, 2026
Copilot AI requested a review from Menelion January 14, 2026 12:40
@Menelion Menelion marked this pull request as ready for review January 14, 2026 12:47
@Menelion Menelion merged commit 3f50dc8 into dev-vs-ci Jan 14, 2026
@Menelion Menelion deleted the copilot/sub-pr-32 branch January 14, 2026 12:48
Menelion added a commit that referenced this pull request Jan 14, 2026
* Try to reconcile dev with CI and fix tests finally

* Fix CS

* Try fixing workflow

* More fixes

* Meow

* Meow2

* Meow3

* Meow4

* Meow5

* meow6

* meow7

* Meow8

* Meow9

* meow11

* Meow12

* meow13

* meow14

* Meow10

* meow15

* meow16

* meow17

* meow18

* meow19

* meow20

* meow21

* meow22

* meow23

* meow23

* meow24

* meow25

* meow26

* meow27

* Fix SFTP test failures in chrooted environments (#33)

* Initial plan

* Fix SFTP test root path handling for chrooted environments

- Handle empty SFTP_TEST_ROOT properly (use relative path instead of /tmp/sharpsync-tests)
- When root is empty string (chrooted env), use relative paths for test directories
- This fixes "No such file" errors when creating test directories in CI

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Improve SFTP chroot detection and path handling

- Simplify chroot detection: assume relative paths when RootPath doesn't start with "/"
- Fix exception handling to catch SftpPathNotFoundException in addition to permission errors
- This should fix issues with chrooted SFTP environments in CI
- Separate chroot detection from root path creation logic

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix whitespace formatting in SftpStorageTests.cs (#34)

* Initial plan

* Fix whitespace formatting in SftpStorageTests.cs

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix SFTP integration tests by configuring writable chroot directory (#35)

* Initial plan

* Fix SFTP test configuration for chrooted environment

- Change SFTP container to use command array format for proper parsing
- Set SFTP_TEST_ROOT to "upload" directory which is writable by test user
- Remove volume mount that was causing permission issues
- The atmoz/sftp image chroots users and only specified directories are writable
- This fixes "No such file" errors when SFTP tests try to create directories

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix WebDAV GetRelativePath to handle full URLs from server responses (#36)

* Initial plan

* Fix WebDavStorage GetRelativePath to correctly strip root path from WebDAV resource URLs

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix WebDavStorage GetRelativePath to handle full URLs from WebDAV server

Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Menelion <595597+Menelion@users.noreply.github.com>

* Fix CS

* Fix WebDAV CreateDirectoryAsync to ensure root path exists before creating subdirectories

CreateDirectoryAsync was missing the call to EnsureRootPathExistsAsync that
WriteFileAsync already had. This caused integration tests to fail because each
test uses a unique root path (containing a GUID for isolation), and attempting
to create subdirectories like "test/subdir" would fail with 409 Conflict when
the root path itself didn't exist yet.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove garbage

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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