Skip to content

handle case where we can't get the filesize after open in dav get#58550

Open
icewind1991 wants to merge 1 commit intomasterfrom
dav-open-size-not-found
Open

handle case where we can't get the filesize after open in dav get#58550
icewind1991 wants to merge 1 commit intomasterfrom
dav-open-size-not-found

Conversation

@icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Feb 24, 2026

@icewind1991 icewind1991 requested a review from a team as a code owner February 24, 2026 15:34
@icewind1991 icewind1991 requested review from Altahrim, ArtificialOwl, artonge and come-nc and removed request for a team February 24, 2026 15:34
@icewind1991 icewind1991 marked this pull request as draft February 24, 2026 15:34
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the dav-open-size-not-found branch from 04eaca0 to 9d7d562 Compare February 24, 2026 17:11
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Feb 24, 2026
@icewind1991 icewind1991 added this to the Nextcloud 34 milestone Feb 24, 2026
@icewind1991 icewind1991 marked this pull request as ready for review February 24, 2026 17:11
@icewind1991 icewind1991 requested a review from susnux February 24, 2026 19:22
if ($this->getSize() !== $fsSize) {
$logger = Server::get(LoggerInterface::class);
if ($fsSize === false) {
$logger->warning('file not found on storage after successfully opening it');
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense (for proper client error code) to throw a StorageNotAvailableException here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Given that the file opened successfully, I'm not sure if we should return an error or just try to read the handle we got an hope that that gives the correct content.

We don't really have enough info to determine that.

@susnux susnux added the bug label Feb 24, 2026
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