-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement listing favorites via the dav report API #2086
Conversation
fb8a755
to
6eee683
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having persistence here and not only a memory implementation will take this PR further 👯
|
||
// InMemoryManager implements the Manager interface to manage favorites using an in-memory storage. | ||
type InMemoryManager struct { | ||
favorites map[string]map[string]*provider.ResourceId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also mind that a map is not thread safe and will panic if concurrent writes. A mutex should guard against this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it won't work without a lock
6eee683
to
053d660
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the first step. @labkode @ishank011 please review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishank011, it was agreed that this is just the short-term solution and a more future proof solution will follow. See #2036 |
@C0rby thanks! Can you add the mutex protection? We can merge it then |
@C0rby can you take a look at the failing tests, please? |
Yeah, I'm on it. |
I added filter-files to the dav REPORT API. This enables the listing of favorites.
[full-ci] fix unexpected passes for cs3org/reva#2086
Merge: c0a20b2 e2a6b5d Author: Willy Kloucek <[email protected]> Date: Wed Oct 6 09:15:44 2021 +0200 Merge pull request #2581 from owncloud/report_unexpected_passes [full-ci] fix unexpected passes for cs3org/reva#2086
I added filter-files to the dav REPORT API. This enables the listing of
favorites.
This is the rework of #2071
See #2071 (comment).