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

properly preserve the format of e2ee metadata during DB operations #5577

Merged
merged 3 commits into from
Apr 12, 2023

Conversation

mgallien
Copy link
Collaborator

@mgallien mgallien commented Apr 5, 2023

before this patch we may put the e2ee version format to v1.2 when it was not the case

src/libsync/syncfileitem.cpp Outdated Show resolved Hide resolved
@mgallien mgallien force-pushed the bugfix/migrateE2eeMetadata branch 2 times, most recently from 9ecd98f to d84d215 Compare April 6, 2023 09:12
@allexzander allexzander self-requested a review April 6, 2023 13:48
@mgallien mgallien force-pushed the bugfix/migrateE2eeMetadata branch from 8dc9d14 to fcc9d38 Compare April 11, 2023 21:11
@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #5577 (9486978) into master (d5bddb9) will increase coverage by 0.00%.
The diff coverage is 63.63%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5577   +/-   ##
=======================================
  Coverage   59.23%   59.24%           
=======================================
  Files         143      143           
  Lines       18437    18445    +8     
=======================================
+ Hits        10922    10928    +6     
- Misses       7515     7517    +2     
Impacted Files Coverage Δ
src/common/syncjournalfilerecord.h 54.54% <0.00%> (ø)
src/csync/csync.h 75.00% <ø> (ø)
src/libsync/encryptfolderjob.cpp 0.00% <0.00%> (ø)
src/libsync/owncloudpropagator.cpp 84.95% <0.00%> (ø)
src/libsync/propagatedownloadencrypted.cpp 0.00% <ø> (ø)
src/libsync/propagateremotedeleteencrypted.cpp 0.00% <ø> (ø)
...bsync/propagateremotedeleteencryptedrootfolder.cpp 0.00% <ø> (ø)
src/libsync/propagateremotemkdir.cpp 64.78% <0.00%> (ø)
src/libsync/propagateuploadencrypted.cpp 0.00% <0.00%> (ø)
src/libsync/discovery.cpp 86.01% <50.00%> (ø)
... and 3 more

... and 2 files with indirect coverage changes

@mgallien mgallien force-pushed the bugfix/migrateE2eeMetadata branch from fcc9d38 to 2610944 Compare April 12, 2023 08:30
@@ -73,7 +69,7 @@ class OCSYNC_EXPORT SyncJournalFileRecord
[[nodiscard]] bool isVirtualFile() const { return _type == ItemTypeVirtualFile || _type == ItemTypeVirtualFileDownload; }
[[nodiscard]] QString path() const { return QString::fromUtf8(_path); }
[[nodiscard]] QString e2eMangledName() const { return QString::fromUtf8(_e2eMangledName); }
[[nodiscard]] bool isE2eEncrypted() const { return _isE2eEncrypted != SyncJournalFileRecord::EncryptionStatus::NotEncrypted; }
[[nodiscard]] bool isE2eEncrypted() const { return _e2eEncryptionStatus != SyncJournalFileRecord::EncryptionStatus::NotEncrypted; }
Copy link
Contributor

Choose a reason for hiding this comment

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

SyncJournalFileRecord::EncryptionStatus::NotEncrypted -> EncryptionStatus::NotEncrypted

@@ -234,7 +229,7 @@ class OWNCLOUDSYNC_EXPORT SyncFileItem
&& !(_instruction == CSYNC_INSTRUCTION_CONFLICT && _status == SyncFileItem::Success);
}

[[nodiscard]] bool isEncrypted() const { return _isEncrypted != SyncFileItem::EncryptionStatus::NotEncrypted; }
[[nodiscard]] bool isEncrypted() const { return _e2eEncryptionStatus != SyncFileItem::EncryptionStatus::NotEncrypted; }
Copy link
Contributor

Choose a reason for hiding this comment

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

SyncFileItem::EncryptionStatus::NotEncrypted -> EncryptionStatus::NotEncrypted

@mgallien mgallien force-pushed the bugfix/migrateE2eeMetadata branch from 2610944 to 4f00374 Compare April 12, 2023 08:48
@allexzander allexzander self-requested a review April 12, 2023 09:15
before this patch we may put the e2ee version format to v1.2 when it was
not the case

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
will consider v1.2 stored encryption status in DB to be equivalent to v1
due to bugs in the v3.8.0 release

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
@mgallien mgallien force-pushed the bugfix/migrateE2eeMetadata branch from 4f00374 to 9486978 Compare April 12, 2023 13:46
@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-5577-94869783d3443da3f66b9e9431945674090bc330-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.

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

58.7% 58.7% Coverage
0.0% 0.0% Duplication

@mgallien mgallien merged commit da45b6f into master Apr 12, 2023
@mgallien mgallien deleted the bugfix/migrateE2eeMetadata branch April 12, 2023 16:31
@mgallien
Copy link
Collaborator Author

/backport to stable-3.8

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