Skip to content

Conversation

@skjnldsv
Copy link
Member

Prevent one additional request in case the backend said there was no preview.
This property does NOT mean the preview was not generated, but it actually means we CANNOT generate it (disabled or no preview available)

Good suggestion by @icewind1991 !

@skjnldsv skjnldsv added this to the Nextcloud 32 milestone May 14, 2025
@skjnldsv skjnldsv requested review from icewind1991 and susnux May 14, 2025 09:09
@skjnldsv skjnldsv self-assigned this May 14, 2025
@skjnldsv skjnldsv requested a review from a team as a code owner May 14, 2025 09:09
@skjnldsv skjnldsv requested review from artonge and nfebe and removed request for a team May 14, 2025 09:09
@skjnldsv
Copy link
Member Author

/backport to stable31

@skjnldsv
Copy link
Member Author

/backport to stable30

@skjnldsv skjnldsv changed the title fix(files): do not even try to fetch a preview if èhas-preview` is false fix(files): do not even try to fetch a preview if has-preview is false May 14, 2025
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

I do not really expect performance improvements as mimeFallback on the preview endpoint should also check this so so we already would get the mime type icon.

Also one thing to consider is that doing this will stop the browser from caching the mime icon as the preview, so other apps might need to do this as well otherwise we do not save anything 😔

@skjnldsv
Copy link
Member Author

This created issues, for some reason I got many img loading errors after this PR.
I refactored the handling a bit and unified the way we set and reset the preview to avoid prop update race conditions/conflicts

@skjnldsv
Copy link
Member Author

I do not really expect performance improvements as mimeFallback on the preview endpoint should also check this so so we already would get the mime type icon.

This removes one request :)

@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels May 14, 2025
@skjnldsv

This comment was marked as resolved.

@skjnldsv skjnldsv force-pushed the fix/preview-check branch from d9760e6 to 502e57d Compare May 14, 2025 12:19
@skjnldsv
Copy link
Member Author

Now cancelling doesn't work 🛑

fixed

@skjnldsv

This comment was marked as resolved.

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/preview-check branch from 502e57d to 37d4bdc Compare May 14, 2025 12:22
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@skjnldsv skjnldsv enabled auto-merge May 14, 2025 13:28
@skjnldsv skjnldsv disabled auto-merge May 14, 2025 13:49
@skjnldsv skjnldsv merged commit 4635cb4 into master May 14, 2025
129 of 135 checks passed
@skjnldsv skjnldsv deleted the fix/preview-check branch May 14, 2025 13:50
@skjnldsv skjnldsv mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants