Repository navigation
fix: Skip /access request when a file can't be shared - #2095
Merged
Merged
Conversation
Copilot
AI
changed the title
Avoid unnecessary /access calls when file cannot be shared
Skip /access request when a file can't be shared
Sep 29, 2026
Copilot created this pull request from a session on behalf of
PhilippeWeidmann
September 29, 2026 08:47
tevincent
requested changes
Sep 29, 2026
tevincent
approved these changes
Sep 29, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Share-link retrieval is incorrectly guarded despite the stated requirement that it remain unconditional.
Review effort: Balanced
Findings: 1
What changed in this PR
Guards /access requests for files without sharing rights.
Changes:
- Checks
canSharebefore fetching file-sharing details. - Extracts share retrieval into a helper.
| File | Description |
|---|---|
FileDetailsFragment.kt |
Guards share-detail retrieval. |
FileShareDetailsFragment.kt |
Separates and guards share retrieval. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tevincent
force-pushed
the
copilot/fix-unnecessary-access-calls
branch
2 times, most recently
from
September 29, 2026 09:17
f979df1 to
c797146
Compare
tevincent
enabled auto-merge
September 29, 2026 09:17
Co-authored-by: PhilippeWeidmann <5843044+PhilippeWeidmann@users.noreply.github.com>
Co-authored-by: PhilippeWeidmann <5843044+PhilippeWeidmann@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
tevincent
force-pushed
the
copilot/fix-unnecessary-access-calls
branch
from
September 29, 2026 09:18
c797146 to
7d52606
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




The file details and file sharing screens always hit the
/accessendpoint, even for files the user has no sharing rights on, producing failing/useless requests. Mirrors the iOS fix inInfomaniak/ios-kDrive#2035.Changes
FileDetailsFragment: wraps thegetFileShare(fileId)observer in arights?.canShare == truecheck on the fetched file details.FileShareDetailsFragment: extracts the share fetching fromrefreshUi()into a privategetFileShare(), invoked only whenfile.rights?.canShare == true. Share link retrieval (getShareLink) stays unconditional, so direct navigation to this screen for a non-shareable file still renders without the/accesscall.Rights.canShareis a non-nullBoolean, so== trueonly guards against a nullrightsobject.