Skip to content

Fix "wrong owner type" issue when deleting a file from the viewer#2942

Merged
skjnldsv merged 1 commit into
masterfrom
fix/wrongOwnerType
Aug 28, 2025
Merged

Fix "wrong owner type" issue when deleting a file from the viewer#2942
skjnldsv merged 1 commit into
masterfrom
fix/wrongOwnerType

Conversation

@salmart-dev

@salmart-dev salmart-dev commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

Fixes: #2943

This PR fixes an issue where deleting a file while being in the viewer fails because of "wrong owner type".

The issue above happens because the client.stat requests has a Number for ownerId, when the ownerId is a number (e.g. 123456).

@salmart-dev salmart-dev self-assigned this Aug 28, 2025
@salmart-dev salmart-dev added bug Something isn't working 3. to review Waiting for reviews labels Aug 28, 2025

@AndyScherzinger AndyScherzinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🐘

@AndyScherzinger AndyScherzinger added this to the Nextcloud 32 milestone Aug 28, 2025
@AndyScherzinger

Copy link
Copy Markdown
Member

/backport to stable31

@backportbot backportbot Bot added the backport-request Pending backport by the backport-bot label Aug 28, 2025
@AndyScherzinger

Copy link
Copy Markdown
Member

/backport to stable30

@AndyScherzinger

Copy link
Copy Markdown
Member

/backport to stable29

@skjnldsv

Copy link
Copy Markdown
Member

Nice catch!

@skjnldsv

Copy link
Copy Markdown
Member

/compile rebase

The ownerId is supposed to always be a string value, but if someone's
userId is a Numeric name, then file deletion breaks, because the ownerId
is taken in as Number.

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
@salmart-dev salmart-dev enabled auto-merge August 28, 2025 10:55
@skjnldsv skjnldsv disabled auto-merge August 28, 2025 11:24
@skjnldsv skjnldsv merged commit fcfa54e into master Aug 28, 2025
45 of 51 checks passed
@skjnldsv skjnldsv deleted the fix/wrongOwnerType branch August 28, 2025 11:24
@backportbot

backportbot Bot commented Aug 28, 2025

Copy link
Copy Markdown

The backport to stable29 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable29
git pull origin stable29

# Create the new backport branch
git checkout -b backport/2942/stable29

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick e573302e

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/2942/stable29

Error: Failed to check for changes with origin/stable29: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot

backportbot Bot commented Aug 28, 2025

Copy link
Copy Markdown

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30

# Create the new backport branch
git checkout -b backport/2942/stable30

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick e573302e

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/2942/stable30

Error: Failed to check for changes with origin/stable30: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot

backportbot Bot commented Aug 28, 2025

Copy link
Copy Markdown

The backport to stable31 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable31
git pull origin stable31

# Create the new backport branch
git checkout -b backport/2942/stable31

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick e573302e

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/2942/stable31

Error: Failed to check for changes with origin/stable31: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

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 backport-request Pending backport by the backport-bot bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Impossible to delete any file, when the owner has a numeric name

3 participants