Skip to content
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/sync with case clash names #5232

Merged
merged 14 commits into from
Jan 26, 2023
Merged

Conversation

mgallien
Copy link
Collaborator

@mgallien mgallien commented Dec 1, 2022

@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch from 40fd992 to 0c4d898 Compare December 1, 2022 14:44
Copy link
Collaborator

@claucambra claucambra left a comment

Choose a reason for hiding this comment

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

Just some small nitpicks, please clean up history when done :)

src/libsync/discovery.cpp Outdated Show resolved Hide resolved
src/libsync/discovery.cpp Outdated Show resolved Hide resolved
src/libsync/discovery.cpp Outdated Show resolved Hide resolved
src/libsync/owncloudpropagator.cpp Outdated Show resolved Hide resolved
src/libsync/propagatedownload.cpp Outdated Show resolved Hide resolved
src/libsync/propagatedownload.cpp Outdated Show resolved Hide resolved
src/libsync/propagatedownload.cpp Outdated Show resolved Hide resolved
@claucambra
Copy link
Collaborator

The sync engine test has crashed in the Windows pipeline, unsure if this is related to the changes

@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch 2 times, most recently from 0351873 to fe7e992 Compare December 2, 2022 08:27
@tobiasKaminsky
Copy link
Member

image

--> there should be a button "resolve conflict", so that it is better visible to the user how to fix this.

@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch from f27a5b1 to 38daad6 Compare December 9, 2022 11:15
@mgallien mgallien added this to the 3.6.4 milestone Dec 12, 2022
@mgallien mgallien linked an issue Dec 14, 2022 that may be closed by this pull request
@claucambra claucambra force-pushed the feature/syncWithCaseClashNames branch from 9640e87 to 42884f5 Compare December 14, 2022 19:27
@mgallien mgallien removed this from the 3.6.4 milestone Dec 15, 2022
@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch from 42884f5 to 6939441 Compare December 15, 2022 11:29
@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #5232 (94605d2) into master (5c42da4) will increase coverage by 0.24%.
The diff coverage is 73.49%.

❗ Current head 94605d2 differs from pull request most recent head fbb0a33. Consider uploading reports for the commit fbb0a33 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5232      +/-   ##
==========================================
+ Coverage   58.06%   58.31%   +0.24%     
==========================================
  Files         139      141       +2     
  Lines       17710    17990     +280     
==========================================
+ Hits        10283    10490     +207     
- Misses       7427     7500      +73     
Impacted Files Coverage Δ
src/common/preparedsqlquerymanager.h 0.00% <ø> (ø)
src/common/syncjournaldb.h 66.66% <ø> (ø)
src/common/utility.h 0.00% <ø> (ø)
src/csync/csync.h 75.00% <ø> (ø)
src/csync/csync_exclude.h 0.00% <ø> (ø)
src/libsync/discoveryphase.h 25.00% <ø> (ø)
src/libsync/owncloudpropagator.h 66.12% <ø> (-2.53%) ⬇️
src/libsync/progressdispatcher.cpp 53.80% <0.00%> (-0.32%) ⬇️
src/libsync/syncengine.h 50.00% <ø> (ø)
src/libsync/caseclashconflictsolver.cpp 42.73% <42.73%> (ø)
... and 14 more

@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch 8 times, most recently from db8928d to f4f2987 Compare December 21, 2022 00:01
@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch 2 times, most recently from f333549 to 5321f9a Compare January 3, 2023 08:27
@allexzander
Copy link
Contributor

@matthieugallien Could you add a short video of how this feature works?

@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch 2 times, most recently from 3172ff1 to 4d60f75 Compare January 11, 2023 15:41
src/common/syncjournaldb.h Outdated Show resolved Hide resolved
src/common/utility.cpp Outdated Show resolved Hide resolved
src/libsync/caseclashconflictsolver.cpp Outdated Show resolved Hide resolved
src/libsync/caseclashconflictsolver.cpp Outdated Show resolved Hide resolved
src/libsync/caseclashconflictsolver.cpp Outdated Show resolved Hide resolved
src/libsync/caseclashconflictsolver.h Outdated Show resolved Hide resolved
src/libsync/caseclashconflictsolver.h Outdated Show resolved Hide resolved
@@ -913,6 +913,63 @@ bool OwncloudPropagator::createConflict(const SyncFileItemPtr &item,
return true;
}

OCC::Optional<QString> OwncloudPropagator::createCaseClashConflict(const SyncFileItemPtr &item, const QString &temporaryDownloadedFile)
{
auto filename = QString{};
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think the auto is particularly helpful here

Suggested change
auto filename = QString{};
QString filename;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I disagree
I do not see a good reason not to use it
I have always find that almost always auto is a good rule
we should have auto everywhere unless there is a reason it cannot be used

status = SyncFileItem::NormalError;
} else {
status = SyncFileItem::FileIgnored;
ASSERT(_item->_instruction == CSYNC_INSTRUCTION_IGNORE);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not a Q_ASSERT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the ASSERT macro will also print a message in release mode if it fails

src/libsync/propagatedownload.cpp Outdated Show resolved Hide resolved
@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch from 4d60f75 to 7cebb6a Compare January 24, 2023 21:36
Copy link
Collaborator

@claucambra claucambra left a comment

Choose a reason for hiding this comment

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

Merge commit probably needs to be removed before merging this PR, otherwise looks good

mgallien and others added 14 commits January 25, 2023 16:37
introduce a new type of conflict for case clash filename conflicts

add proper handling including a new utility class to solve them and a
new dialog for the user to pick a fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
…ution dialog

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
@mgallien mgallien force-pushed the feature/syncWithCaseClashNames branch from 94605d2 to fbb0a33 Compare January 25, 2023 15:37
@mgallien
Copy link
Collaborator Author

Merge commit probably needs to be removed before merging this PR, otherwise looks good

done
thanks for the notice

@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-5232-fbb0a33eb702f7518ceb3fd79699488843ce3c05-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@sonarcloud
Copy link

sonarcloud bot commented Jan 25, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 74 Code Smells

13.2% 13.2% Coverage
2.7% 2.7% Duplication

@mgallien mgallien merged commit aa74448 into master Jan 26, 2023
@mgallien mgallien deleted the feature/syncWithCaseClashNames branch January 26, 2023 08:05
@mgallien mgallien added this to the 3.7.0 milestone Jan 30, 2023
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.

Allow syncing file with case clash names
5 participants