-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/automate windows file name compatibility #7850
base: master
Are you sure you want to change the base?
Conversation
enforce trailing and leading space rules for new files and only for new files but on all platforms, not only windows Signed-off-by: Matthieu Gallien <[email protected]>
to ensure compatibility with Widnows, we will remove automatically the leading space characters in file name of new files or folders Signed-off-by: Matthieu Gallien <[email protected]>
Signed-off-by: Matthieu Gallien <[email protected]>
for now simple rule to guess if the server has windows naming enforced if windows naming is enforced, we enforce it for new files if not, we do not care for now limited to spaces removal more to come Signed-off-by: Matthieu Gallien <[email protected]>
Artifact containing the AppImage: nextcloud-appimage-pr-7850.zip SHA256 checksum: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall, tests are failing though (also on windows)
QCOMPARE(completeSpy.findItem(fileWithSpaces1)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces2)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces3)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces4)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces5)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces6)->_status, SyncFileItem::Status::FileNameInvalid); | ||
#else | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces1)->_status, SyncFileItem::Status::Success); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did these get removed?
running the tests on e.g. linux these items still end up with a status of Success
2025-02-13T07:43:29.5350432Z FAIL! : TestSyncVirtualFiles::testCreateFileWithTrailingSpaces_acceptAndRejectInvalidFileName() Compared values are not the same
2025-02-13T07:43:29.5350569Z Actual (completeSpy.findItem(fileWithSpaces1)->_status): Success
2025-02-13T07:43:29.5350719Z Expected (SyncFileItem::Status::FileNameInvalid) : FileNameInvalid
2025-02-13T07:43:29.5350832Z Loc: [/__w/desktop/desktop/test/testsyncvirtualfiles.cpp(838)]
QCOMPARE(completeSpy.findItem(fileWithSpaces1)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces2)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces3)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces4)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces5)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(fileWithSpaces6)->_status, SyncFileItem::Status::FileNameInvalid); | ||
QCOMPARE(completeSpy.findItem(extraFileNameWithSpaces)->_status, SyncFileItem::Status::FileNameInvalid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these end up as Success
too on the Linux tests even with the setLocalDiscoveryEnforceWindowsFileNameCompatibility
option enabled on the syncEngine -- in the SyncEngine::startSync
method this property gets set on the DiscoveryPhase
object that is used by the discovery jobs only depending on the account caps...
No description provided.