Update SetRole/SetUserTitle so that you have to be subscribed to get it, also...
Update SetRole/SetUserTitle so that you have to be subscribed to get it, also added a script to generate flow.txt and cleaned up communtiy_flow
Merge request reports
Activity
requested review from @bwrona
assigned to @howo
@bwrona I found out that the flow.txt in the mocks doesn't really reflect what's in the mocks, I think mostly because the file is manually edited which is prone to human errors, I created a script that you'll find in this merge request to automatically generate the flows.txt, thoughts ?
added 1 commit
- 9f6a753c - Allows setting the muted role even if you're not subscribed
mentioned in issue hive#260 (closed)
- Resolved by Bartek Wrona
Well, those flow.txt files have been incorporated to allow describing scenarios applied to mocks. Since scenarios can be splitted across multiple blocks it can be complex to understand what happens. I am not sure if any automation is needed here and even possible. Just flow files shall be updated when new tests come.
added 17 commits
-
410f7e2f...ff7a4481 - 13 commits from branch
develop
- d903c6a4 - Update SetRole/SetUserTitle so that you have to be subscribed to get it, also...
- ee5a840b - added communtiy_helpers to base schema
- 655f9f7a - Allows setting the muted role even if you're not subscribed
- fe206421 - small fix
Toggle commit list-
410f7e2f...ff7a4481 - 13 commits from branch
added 12 commits
-
b7f10b8e...f5c94589 - 4 commits from branch
develop
- cc8fe338 - Update SetRole/SetUserTitle so that you have to be subscribed to get it, also...
- 4ec4ad8d - added communtiy_helpers to base schema
- 54d5128f - Allows setting the muted role even if you're not subscribed
- 12a1883a - small fix
- 37343dba - first fix try
- ec4da0c2 - attempt at fixing most tests
- fbb9bd3a - fix all tests
- 7910ac23 - Added flow.txt where it's missed
Toggle commit list-
b7f10b8e...f5c94589 - 4 commits from branch
added 10 commits
-
7910ac23...d8ef9adc - 2 commits from branch
develop
- e710b92c - Update SetRole/SetUserTitle so that you have to be subscribed to get it, also...
- 446a4c1b - added communtiy_helpers to base schema
- 9dc83b3b - Allows setting the muted role even if you're not subscribed
- cbb74d37 - small fix
- ec803921 - first fix try
- 566a71ab - attempt at fixing most tests
- 6acdb300 - fix all tests
- 066762c7 - Added flow.txt where it's missed
Toggle commit list-
7910ac23...d8ef9adc - 2 commits from branch
added Review label
added 10 commits
- 7f0cc6d5 - Update SetRole/SetUserTitle so that you have to be subscribed to get it, also...
- 2e9081e5 - added communtiy_helpers to base schema
- 3ecaf640 - Allows setting the muted role even if you're not subscribed
- 7c467c37 - small fix
- 4e2946f7 - first fix try
- 0b705204 - attempt at fixing most tests
- 555d03c6 - fix all tests
- 2a80d650 - Added flow.txt where it's missed
- 1144c265 - Merge branch 'feature/role-only-if-subscribed' of...
- e0ed25f8 - Added test cases in the mocks + pattern tests
Toggle commit listadded 1 commit
- 3eb72984 - Fix pattern tests following changes in mocks
@bwrona Ready for review, I added new mocks and a pattern test to test the results.
The goal of the feature is to prevent setting a title / role to someone who isn't subscribed to a community (as it's currently used by admins to give legitimacy to scam communities).
One small caveat is that we should still be able to set a lower role in case the user is unsubscribed, that way if the user is a mod and unsubscribed, he can still be downgraded to member (or muted).
So here are the test cases:
- The account
ismember
is subscribed. We give him the titleIs set
and themod
role - The account
notmember
is not subscribed. We try to give him the titleIs not set
and themod role
, none of those are applied - The account
notmembermuted
is not subscribed. We give him the rolemuted
- The account
isoldmember
is subscribed, we give him themod
role, then he unsubscribes and we downgrade him tomember
As a result the state is like this for roles/titles:
-
isoldmember
=>member
, title:Is set
-
notmembermuted
=>muted
-
notmember
=>no role
-
ismember
=>mod
The final state is tested in this pattern test: https://gitlab.syncad.com/hive/hivemind/-/blob/79d7610c170bd19113363d4ce50a050f42c92578/tests/api_tests/hivemind/tavern/bridge_api_patterns/list_community_roles/test-set_role_199999.pat.json
Edited by Howo- The account