Repository navigation
feat(graph): expose the favorite state on drives and sharedWithMe - #4036
Merged
Merged
Conversation
Spaces and received shares can be marked as favorites, but the graph API did not report it, so the web app could not show them. drive.root and the sharedWithMe driveItems now carry @libre.graph.me.following. The space root info only holds the requested quota metadata, so the per-user flag is also read from the favorites list the storage driver adds to the opaque. Fixes #2511
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 10 |
🟢 Coverage 81.82% diff coverage · +0.02% coverage variation
Metric Results Coverage variation ✅ +0.02% coverage variation (-1.00%) Diff coverage ✅ 81.82% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (0ec0411) 94240 28196 29.92% Head commit (d2b1ab3) 94263 (+23) 28219 (+23) 29.94% (+0.02%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4036) 22 18 81.82% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
2 of 7 tasks
v-scharf
added a commit
to opencloud-eu/web
that referenced
this pull request
Nov 20, 2026
…and shares The e2e tests for favorite spaces and shares need the favorite state on drives and shares from opencloud-eu/opencloud#4036. Assisted-by: Claude Code:claude-opus-5-5
v-scharf
added a commit
to opencloud-eu/web
that referenced
this pull request
Nov 23, 2026
…and shares The e2e tests for favorite spaces and shares need the favorite state on drives and shares from opencloud-eu/opencloud#4036. Assisted-by: Claude Code:claude-opus-5-5
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.
Description
Spaces and shares can already be marked as favorites, but the graph API did not report the favorite state for them. This adds
@libre.graph.me.followingto:drive.rooton the drive endpoints (/me/drives,/drives,/drives/{id}, v1.0 and v1beta1), including mountpoint drives/v1beta1/me/drive/sharedWithMesharedByMealready returned the flag throughcs3ResourceToDriveItem.The root info of a space is built with only the
quotametadata key, so the per-user favorite flag is not part of its arbitrary metadata. The newisFollowinghelper therefore also checks thefavoritesopaque entry, which the storage driver adds to every resource info (the search service already relies on it foris:favorite). The flag is set only when the space has a root info.Related Issue
Motivation and Context
The web app needs the favorite state on spaces and received shares to show and toggle it.
How Has This Been Tested?
POST /graph/v1.0/me/drive/items/{id}/follow/me/drives(v1.0 and v1beta1) and/drives/{id}:truefor alan on the followed space,falseon the other one; mary and admin getfalseon bothDELETE /me/drive/following/{id}alan getsfalseagainsharedWithMeand the mountpoint drive showtruefor alan andfalsefor dennis; after mary follows it herself, hersharedByMeshowstrueFound while testing, not changed here: following a received share by its share jail id (the
idof the sharedWithMe driveItem) fails with 500 "could not add label", because the sharesstorageprovider does not implementAddLabel/RemoveLabel. Following byremoteItem.idworks.Types of changes
Checklist: