Skip to content

Clicking an EPUB in a file list does nothing the first time when the URL has scrollTo #4389

Closed

Description

@AlexAndBear

Initial Checklist

  • I understand this is a bug report and questions should be posted in the Community Discussions
  • I searched issues and couldn’t find anything (or linked relevant results below)

Bug Description

In 7.2.4 one click on an EPUB opens the reader. On main the first click only selects the row and removes scrollTo from the URL whenever the list URL has scrollTo: after closing any viewer, /f/<id>?details=sharing, a bookmarked URL, a folder URL pointing to a file, search results, public links. A second click is needed. Only the EPUB reader is affected, because its route is lazy loaded, and only on its first open per page load. PDF viewer, text editor, preview and folders open on the first click. Desktop and Pixel 7, table and tiles.

Regression compared with OpenCloud 7.2.4 (web 7.1.5), found in the regression test before the release. Introduced by PR #4118 / 77eae1a (reset on selecting another resource); mechanism from PR #2752 / 10456c5.

Cause: packages/web-app-files/src/composables/resourcesViewDefaults/useResourcesViewDefaults.ts:204-208: the click starts the router-link push to epub-reader, then the same click selects the row. The selected row is not the scrollTo target, so resetScrollToParam() (:156-157, useRouteQuery setter) calls router.replace, which cancels the push that is still waiting for the lazy EPUB reader chunk. 7.1.5 had no scrollTo reset.

Possible fix: Don't strip scrollTo with a router navigation while another navigation is pending, or reset it only on an emptied selection in a way that can't cancel navigations.

Reproduction Steps

  1. Log in as dennis and open a folder containing a-red.png and m-book.epub (table or tiles).
  2. Click a-red.png; the preview opens. Close it with X (the list URL now has scrollTo=<id>).
  3. Click m-book.epub once.

Expected Outcome

The EPUB reader opens on the first click.

Actual Outcome

Nothing opens. The row gets selected and scrollTo is removed from the URL; only the second click opens the reader.

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

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions