-
Notifications
You must be signed in to change notification settings - Fork 2
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
ListThread service: add is_mine parameter #943
Conversation
e69a78c
to
b644c9f
Compare
Codecov Report
@@ Coverage Diff @@
## master #943 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 225 225
Lines 13466 13503 +37
=========================================
+ Hits 13466 13503 +37
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
40b5a4e
to
8eda029
Compare
Missing ref to the issue it is fixing. |
It's not finished yet, still requires the parameter |
d2cd610
to
e39366e
Compare
630119c
to
c5a5bcf
Compare
6b9e41d
to
26ffdc1
Compare
8e5de34
to
5e27812
Compare
5e27812
to
aafeb3e
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.
looks good
testhelpers/feature_context.go
Outdated
@@ -37,11 +37,13 @@ func FeatureContext(s *godog.Suite) { | |||
s.Step(`^there is a group (@\w+)$`, ctx.ThereIsAGroup) | |||
s.Step(`^I am a member of the group (@\w+)$`, ctx.IAmAMemberOfTheGroup) | |||
s.Step(`^I am a member of the group with id "([^"]*)"$`, ctx.IAmAMemberOfTheGroupWithID) | |||
s.Step(`^there are the following group members:$`, ctx.ThereAreTheFollowingGroupMembers) |
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 don't see this rule used anywhere
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.
fixed, indeed I removed it
Issue #888
This PR handles the
is_mine
parameter for the listThread service.Some rights between this and the getThread have been factorized into
WhereUserCanHelp
:The function
NewThreadStore
has been added because when we use a function defined on *DB, we end up being unable to use functions defined on *ThreadStore anymore, because we get a *DB in return. The reason relates to types: A *ThreadStore is a *DataStore is a *DB, but a *DB is not a *ThreadStore.I'm not sure what's the best thing to do here, maybe there exists a pattern that would handle this case smoothly in go. The code seems to struggle with this everywhere, where the pattern used is:
At other times, it returns a *DB instead of a DataStore to avoid this issue. But then we lose consistence with some methods defined on a specific store which returns a specific *DataStore (eg. *ThreadStore, *GroupStore, ...), and others who return a *DB. It would be nice to decide which pattern to use for uniformization, and if possible for simplicity.
Note: I would have liked to add a "default" to the switch statement in list_threads to guarantee the correctness of the parameters. But the parameters are checked before in a function, and it made the code within the default unreachable, so it didn't pass the code coverage tests.