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

Added file previews #3187

Merged
merged 6 commits into from
Mar 26, 2020
Merged

Added file previews #3187

merged 6 commits into from
Mar 26, 2020

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented Mar 16, 2020

Description

Related Issue

Part of #276

Motivation and Context

How Has This Been Tested?

  • manual test, scroll wildly
  • preview in "all files list"
  • previews in public link files list
  • previews in shared file list
  • acceptance tests

Screenshots (if appropriate):

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

@PVince81 PVince81 self-assigned this Mar 16, 2020
@update-docs
Copy link

update-docs bot commented Mar 16, 2020

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@PVince81
Copy link
Contributor Author

seems blob URL doesn't work for the icon component:
image

@PVince81
Copy link
Contributor Author

Previews do work when I scroll over the same element at least once.
I suspect that mounted() from oc-icon is not being called as "iconUrl" is undefined. In error cases it would be an empty string instead of undefined.
Likely related to the way how recycle scroller works.

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 17, 2020

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 18, 2020

added tests but discovered some new issues:

  • preview not loading directly after upload ?
  • scrolling down then back up quicky sometimes removes the already loaded previews: maybe the elements are re-created or something and we need to requery the URL ? (svg appears there for icon type instead of the expected img from the previous load, makes acceptance tests fail)

@PVince81 PVince81 requested a review from LukasHirt March 18, 2020 21:24
@PVince81 PVince81 marked this pull request as ready for review March 18, 2020 21:24
@PVince81
Copy link
Contributor Author

and now the lorem file is locked.
the failures are totally random... I'll try rebasing just in case...

@PVince81
Copy link
Contributor Author

rebased

@PVince81
Copy link
Contributor Author

Seems master is all green #3202

So there is something I changed here that is causing new side effects 😢

@PVince81
Copy link
Contributor Author

seems there's a locking issue.

waiting for previews to always load is not a good idea as we need to use a delay, it will slow down the tests.

idea: add a hidden loading indicator, maybe "data-loading" on the preview while the media source is running, so that the tests know that they need to wait longer.

@PVince81
Copy link
Contributor Author

or use waitForOutstandingAjaxCalls

@PVince81
Copy link
Contributor Author

Added waitForOutstandingAjaxCalls to attempt to wait for previews to be loaded by mediaSource() before continuing. This is to prevent running into situations where the file itself might be locked.

@LukasHirt
Copy link
Collaborator

Pls post a screenshot into description

@PVince81
Copy link
Contributor Author

adjusted and rebased

@PVince81 PVince81 force-pushed the filelist-previews branch 2 times, most recently from 4f950c4 to cc77caf Compare March 23, 2020 14:55
@PVince81
Copy link
Contributor Author

while trying to debug the tests I found more issues which are fixed now:

  • path names with special characters work now (try loading preview for "strängé folder name (duplicate Support apps/plugins #2 &)/strängé filename (duplicate Support apps/plugins #2 &).txt")
  • added limit to concurrent downloads of previews

However there are still these issues:

  • for some strange reason, the preview loading doesn't kick in when entering folder in CI environment
  • due to concurrency, I suspect that the "wait for outstanding ajax calls" would think that the last ajax call was done when maybe next tick the next ajax call will start (in a p-queue env), so need to add a delay there.
  • preview detection still feels unreliable, maybe need to use a data attribute instead with a loading state there...

@PVince81
Copy link
Contributor Author

Seems that waitForAllThumbnailsLoaded is not working:
image

The code is in the right place: https://github.com/owncloud/phoenix/blob/filelist-previews/tests/acceptance/stepDefinitions/filesContext.js#L114

I've now added an extra 1 second delay after waiting, just in case the file locks need more time to release themselves...

@PVince81
Copy link
Contributor Author

now debugging waitForAllThumbnailsLoaded, seems the selector is not working because the attribute is missing when "previewLoaded" is false ?!

@PVince81
Copy link
Contributor Author

okay, seems Vue.js doesn't render HTML attributes if their value is boolean false. Had to set it to the string "false".
also had to fix the selector for waitForAllThumbnailsLoaded to use xpath.

let's see...

@PVince81
Copy link
Contributor Author

I had an explicit check for a file entry in the file list with "upload overwrite" but doesn't cover all cases. We anyway don't need it any more due to the global waiting. So I've added "user browses to files page" before all the overwrite cases.

Squashed

@ownclouders
Copy link
Contributor

💥 Acceptance tests webUIOCIS failed. Please find the screenshots inside ...

https://drone.owncloud.com/owncloud/phoenix/9034/

20200325-122300-836.png
20200325-122328-084.png

Added new component FileItem wrapped around oc-file to
better encapsulated the formatting methods as computed properties
instead of using the mixin.
Added preview support in file list loaded using mediaSource.
@PVince81
Copy link
Contributor Author

added a few more fixes.
the trashbin name was not rendered properly as trashbin must display the original path as prefix

@ownclouders
Copy link
Contributor

💥 Acceptance tests webUIOCIS failed. Please find the screenshots inside ...

https://drone.owncloud.com/owncloud/phoenix/9036/

20200325-140217-889.png
20200325-140304-898.png

Vincent Petry added 3 commits March 25, 2020 15:28
When displaying the file list or scrolling down to formerly invisible
resources, wait for ajax calls to make sure the mediaSource and
preview loading call has ended before performing any operations.

This is to avoid running into file lock issues while loading the
previews.
@PVince81
Copy link
Contributor Author

almost all green, I've pushed one last fix.

the OCIS tests fail, especially the ones related to thumbnail. Not sure if the thumbnailer service is already in place ? if not, we should skip them. do you mind having a look @dpakach ?

@ownclouders
Copy link
Contributor

💥 Acceptance tests webUIOCIS failed. Please find the screenshots inside ...

https://drone.owncloud.com/owncloud/phoenix/9037/

20200325-145625-708.png
20200325-145712-547.png

@dpakach
Copy link
Contributor

dpakach commented Mar 26, 2020

@PVince81, I think we can skip the tests on ocis until we properly implement thumbnail service in CI.

@@ -69,6 +69,7 @@ Feature: Sharing files and folders with internal groups
When the user renames file "lorem.txt" to "new-lorem.txt" using the webUI
And the user shares file "new-lorem.txt" with group "grp1" as "Editor" using the webUI
And the user re-logs in as "user1" using the webUI
And the user browses to the files page
Copy link
Contributor

Choose a reason for hiding this comment

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

can we call waitTillThumbnailsLoaded function in the user has logged in or user has re-logged in step.
That way we can avoid having user has browsed to the files page everywhere after logging in.

@dpakach
Copy link
Contributor

dpakach commented Mar 26, 2020

The CI has passed but I restarted just to make sure it is stable

Copy link
Collaborator

@LukasHirt LukasHirt left a comment

Choose a reason for hiding this comment

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

Code looks good. If you're okay with tests @individual-it @dpakach feel free to merge 😉

@individual-it individual-it merged commit 1a34c63 into master Mar 26, 2020
@delete-merged-branch delete-merged-branch bot deleted the filelist-previews branch March 26, 2020 15:00
if (this.item.etag) {
// add etag for URL based caching
// strip double quotes from etag
query.c = this.item.etag.substr(2, this.item.etag.length - 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

@LukasHirt, oh no here is a bug..
the substr should be substr(1, this.item.etag.length - 2) or else it will cut of the first character. :/

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching that! I'll open a PR with fix and ping you for review 😉

@PVince81 PVince81 mentioned this pull request Apr 14, 2020
9 tasks
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.

6 participants