Comments (7)
I had a chat with @susnux about this and this seems to be a design flaw of the viewer api registering the file type handlers too late. He will think about a possible workaround.
from richdocuments.
Upgraded the 29 instance to 29.0.3, still reproducible sometimes, but now without an error
Edit: Still one for the sidebar:
![Screenshot 2024-07-09 at 10 47 04](https://private-user-images.githubusercontent.com/3404133/346887156-0de3e09b-f126-45c3-9f44-7b03df8b8719.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzMzQyMDYsIm5iZiI6MTcyNDMzMzkwNiwicGF0aCI6Ii8zNDA0MTMzLzM0Njg4NzE1Ni0wZGUzZTA5Yi1mMTI2LTQ1YzMtOWY0NC03YjAzZGY4Yjg3MTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjJUMTMzODI2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTg4MTUwYzNhY2YxMjliYmVlZDllYmNhMThhZDc0NWU4MGU4ZmE1NzRhNmQ2MmExMTc2NWY5M2E2YjA4YzZjZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.PxGl97K2-BU73loq4l_qGcbZLjatGl77mnYjIJc-5a4)
from richdocuments.
cc'ing as requested: @mmeeks @karlitschek
from richdocuments.
We are running 28.0.8 and can still confirm the issue is happening sometimes.
from richdocuments.
@susnux I looked a bit further into it while fixing a regression with 30 nextcloud/server#47014
I still have not managed to trigger this race condition locally. I tried to think about a way to fake this timing issue but cannot figure out how I could manually delay the viewer registration like it is happening on those affected systems. But thought about a workaround like this, kind of deferring the handleOpenFile until the DOMContentLoaded event from viewer has registered the file actions.
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue
index 233353d0985..62cc53fd093 100644
--- a/apps/files/src/components/FilesListVirtual.vue
+++ b/apps/files/src/components/FilesListVirtual.vue
@@ -209,7 +209,7 @@ export default defineComponent({
const { id } = loadState<{ id?: number }>('files', 'fileInfo', {})
this.scrollToFile(id ?? this.fileId)
this.openSidebarForFile(id ?? this.fileId)
- this.handleOpenFile(id ?? null)
+ this.handleOpenFileOnLoad(id ?? null)
},
beforeDestroy() {
@@ -242,6 +242,18 @@ export default defineComponent({
}
},
+ handleOpenFileOnLoad(fileId: number|null) {
+ // This is a workaround as the viewer api registers file actions too late
+ // Some might not be ready yet
+ if (document.readyState === 'complete') {
+ this.$nextTick(() => this.handleOpenFile(fileId))
+ } else {
+ window.addEventListener('load', () => {
+ this.$nextTick(() => this.handleOpenFile(fileId))
+ })
+ }
+ },
+
/**
* Handle opening a file (e.g. by ?openfile=true)
* @param fileId File to open
*
from richdocuments.
kind of deferring the handleOpenFile until the DOMContentLoaded event from viewer has registered the file actions.
This I would say makes sense, though it would cause visual delays on slow connection. But should be a good fix.
from richdocuments.
Thanks Julius - this plagues me many times per day =)
from richdocuments.
Related Issues (20)
- Template creator for PDF files
- Public share of a PDF file with download set to "hidden" does not open automatically
- After enabling this plugin, shared images cannot be displayed in a straight chain format. HOT 3
- Add Cypress testing to cover new template workflow (filling templates)
- Server-Side Validation for “Save As” Actions in Mobile Client Web View HOT 2
- Cache extracted template fields
- Exception":"Error","Message":"Call to a member function xpath() on bool HOT 2
- Shared documents with different results for Dark/Light Modes
- Insert the output of `./occ config:list richdocuments` (or equivalent adapted for your runtime environment) HOT 1
- Cannot insert image from the NC storage into document HOT 1
- #about-dialog too big HOT 1
- [Bug]: PHP unlink error, no such file: `unlink(/var/www/nextcloud/data/appdata_[...]/richdocuments/remoteData/capabilities` HOT 6
- Cannot open documents: "Document loading failed" HOT 4
- [Bug]: Adding a logo in /settings/admin/theming does not change the logo in the Nextcloud Office Editor HOT 1
- "Export as" -> wrong text in popup
- Add template field types for the rest of the Collabora form types
- Integrate Nextcloud Assistant HOT 1
- Theme logo not appearing, top left navigation HOT 1
- Development Edition stops after a few hours? HOT 2
- Errors during template field extraction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from richdocuments.