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

ChunkedFileRemoteOperation: correctly use lastModificationTimestamp #985

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

AlvaroBrey
Copy link
Member

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

SpotBugs (new)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 31
Total 141

SpotBugs (master)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 31
Total 141

@AlvaroBrey
Copy link
Member Author

Fixes nextcloud/android#10900

Confirmed by affected users

Otherwise the age of the copied file is used instead, which may not be desired.

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
@github-actions
Copy link

SpotBugs (new)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 31
Total 141

SpotBugs (master)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 31
Total 141

@codecov
Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Merging #985 (08b0ac2) into master (a7e8143) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #985      +/-   ##
==========================================
- Coverage   48.96%   48.93%   -0.03%     
==========================================
  Files         178      178              
  Lines        6678     6678              
  Branches      884      884              
==========================================
- Hits         3270     3268       -2     
- Misses       2939     2940       +1     
- Partials      469      470       +1     
Impacted Files Coverage Δ
...ources/files/ChunkedFileUploadRemoteOperation.java 25.58% <0.00%> (ø)
...lib/resources/files/UploadFileRemoteOperation.java 52.08% <ø> (ø)
...wncloud/android/lib/resources/files/FileUtils.java 71.42% <0.00%> (-14.29%) ⬇️
.../java/com/nextcloud/common/NextcloudUriDelegate.kt 83.33% <0.00%> (ø)

@tobiasKaminsky
Copy link
Member

Right. Seems we did converting twice.
Can you add info that lastModificationTimestamp must be in seconds, according to unix time?

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
@AlvaroBrey
Copy link
Member Author

AlvaroBrey commented Nov 16, 2022

Right. Seems we did converting twice.

No, the problem here was that ChunkedFileRemoteOperation was ignoring the passed in lastModificationTimestamp and instead using file.lastModified()/1000, which gives the value of the copy, not the original.

Can you add info that lastModificationTimestamp must be in seconds, according to unix time?

Done.

@github-actions
Copy link

SpotBugs (new)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 31
Total 141

SpotBugs (master)

Warning Type Number
Bad practice Warnings 10
Correctness Warnings 35
Internationalization Warnings 6
Malicious code vulnerability Warnings 43
Multithreaded correctness Warnings 3
Performance Warnings 12
Security Warnings 1
Dodgy code Warnings 31
Total 141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File timestamps are not preserved on upload anymore
2 participants