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

Fix preview rendering for sharees #39203

Merged
merged 3 commits into from
Sep 10, 2021
Merged

Fix preview rendering for sharees #39203

merged 3 commits into from
Sep 10, 2021

Conversation

JammingBen
Copy link
Contributor

@JammingBen JammingBen commented Sep 9, 2021

Description

Previous to this fix, the previews of updated shared files did not change for sharees. Those previews now get re-generated if the content of the files changed.

Related Issue

How Has This Been Tested?

See steps in #39202

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@phil-davis
Copy link
Contributor

  • admin shares text.txt with Alice
  • Alice edits text.txt (for example, online with files_texteditor)
  • the preview for Alice is not updated
  • Alice does ctrl-F5 to refresh, or logs out and back in again - still the preview is not updated
  • admin logs in - the updated preview is shown
  • Alice logs in - now the updated preview is shown

In the combinations that I tried, it seems that the sharer needs to login and have the file displayed, and then the preview gets updated for everyone.

@AlexAndBear
Copy link

@phil-davis, we was always logged with the sharer, so yes could be an issue :/

@JammingBen
Copy link
Contributor Author

This happens because the preview of the file owner gets deleted when a sharee edits a file. Therefore we don't have a checksum to compare. @phil-davis Please have a look again, should work now.

@phil-davis
Copy link
Contributor

This happens because the preview of the file owner gets deleted when a sharee edits a file. Therefore we don't have a checksum to compare. @phil-davis Please have a look again, should work now.

Works now. I tried combinations of:

  • share a single file with a group that has Alice and Brian in it. Alice edits the file, both Brian and admin see the updated preview.
  • share a single file with each of Alice and Brian individually. Alice edits the file, both Brian and admin see the updated preview.
  • share a folder with a group that has Alice and Brian in it. Alice edits a file in the folder, both Brian and admin see the updated preview.
  • share a folder with each of Alice and Brian individually. Alice edits a file in the folder, both Brian and admin see the updated preview.

LGTM

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

LGTM - it should be easy to add a few unit tests to cover the new block of code???

@ownclouders
Copy link
Contributor

💥 Acceptance tests pipeline webUIComments-chrome-mariadb10.2-php7.4 failed. The build has been cancelled.

https://drone.owncloud.com/owncloud/core/32252/124/1

@sonarcloud
Copy link

sonarcloud bot commented Sep 10, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

90.9% 90.9% Coverage
0.0% 0.0% Duplication

@phil-davis
Copy link
Contributor

Note: I created issue #39211 to add some acceptance tests. It should not be too hard to keep a record of some simple previews in the acceptance test fixtures, and compare them to the actual generated previews as files are changed.

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