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

[stable27] fix: Wait until file has been added to filelist before opening #45031

Closed
wants to merge 1 commit into from

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented Apr 25, 2024

When creating a new file from a template there is a race condition between the file opening and adding the entry to the file list (which is required by some apps like ONLYOFFICE to obtain further info).

This can be reproduced by setting browser throttling of network connections to be very slow with ONLYOFFICE.

In order to fix that we should wait for the success callback of addAndFetchFileInfo before we continue any further and try to open the file. Await is not working here due to the usage of $.Deferred()

@juliushaertl juliushaertl changed the title fix: Wait until file has been added to filelist before opening [stable27] fix: Wait until file has been added to filelist before opening Apr 25, 2024
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@Pytal
Copy link
Member

Pytal commented Apr 25, 2024

Await is not working here due to the usage of $.Deferred()

Strange as according to docs await should work on any thenable object 🤔

@juliushaertl
Copy link
Member Author

@Pytal Thanks, I was actually wrong with why this happened. It turned out the await was working but depending on the current folder and filename, the $file entry is empty if the file is added to the end of the list and therefore not rendered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants