Thanks to visit codestin.com
Credit goes to github.com

Skip to content

drive: unlink shared files on delete permission errors - #9864

Open
adityabagla7 wants to merge 1 commit into
rclone:masterfrom
adityabagla7:fix/3998-drive-shared-delete
Open

drive: unlink shared files on delete permission errors#9864
adityabagla7 wants to merge 1 commit into
rclone:masterfrom
adityabagla7:fix/3998-drive-shared-delete

Conversation

@adityabagla7

@adityabagla7 adityabagla7 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #3998

Problem

Deleting a Google Drive file that was shared with you fails with:

403: The user does not have sufficient permissions for this file. (insufficientFilePermissions)

Drive rejects deleting the owner's object; recipients should unlink it from the folder they can see instead.

Fix

Follows maintainer option 2 from the issue thread:

  1. Attempt normal trash/delete
  2. On insufficientFilePermissions, fetch parents and removeParents for the single parent
  3. Keep failing safely when there is no parent or multiple parents

Docs / tests

  • Document the behaviour under --drive-shared-with-me
  • Unit tests for permission detection and parent selection

Testing

go test ./backend/drive/ -run 'TestIsInsufficientFilePermissions|TestUnlinkFromParentsDecision' -count=1

@adityabagla7
adityabagla7 requested a review from ncw as a code owner September 4, 2026 16:00
@adityabagla7
adityabagla7 force-pushed the fix/3998-drive-shared-delete branch from 724f01e to a2f5c8d Compare September 7, 2026 14:56
…#3998

Shared Google Drive files often cannot be deleted by recipients
(403 insufficientFilePermissions). Fall back to removeParents so the
file is removed from the visible folder instead of failing the delete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drive: can't delete shared files

1 participant