Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Initial Group Server #2352

Merged
merged 12 commits into from Jul 12, 2017

Conversation

Projects
None yet
2 participants
Owner

erikjohnston commented Jul 10, 2017

No description provided.

erikjohnston added some commits Jul 10, 2017

synapse/groups/attestations.py
+ elif get_domain_from_id(user_id) == self.server_name:
+ server_name = get_domain_from_id(group_id)
+ else:
+ raise Exception("Expected eitehr group_id or user_id to be local")
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

eitehr

synapse/groups/attestations.py
+
+ @defer.inlineCallbacks
+ def verify_attestation(self, attestation, group_id, user_id, server_name=None):
+ """Verifies that the given attestation matches the given paramaters.
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

paramaters

+ group_id TEXT NOT NULL,
+ user_id TEXT NOT NULL,
+ valid_until_ms BIGINT NOT NULL,
+ attestation TEXT NOT NULL
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

Is this json? Should some indication of this either as a comment or as a suffix on the column?

+CREATE TABLE group_rooms (
+ group_id TEXT NOT NULL,
+ room_id TEXT NOT NULL,
+ is_public BOOLEAN NOT NULL
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

What does "is_public" mean? Does it mean the group is public? or does it mean the room is public? or does it mean something else?

+ group_id TEXT NOT NULL,
+ user_id TEXT NOT NULL,
+ is_admin BOOLEAN NOT NULL,
+ is_public BOOLEAN NOT NULL
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

What does "is_public" mean? Does it mean the group is public? or does it mean the room is public? or does it mean something else?

+
+CREATE TABLE groups (
+ group_id TEXT NOT NULL,
+ name TEXT,
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

Should "name" be called "display_name"?

@erikjohnston

erikjohnston Jul 11, 2017

Owner

Why? We don't call room names display names?

@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

Because it makes it easier to tell that it is just a display name. In my opinion we don't have a strong enough convention of using "name" only when we are talking about display names that I can infer that it is a display name just because it is called "name". So I think it either needs to be called "display_name" or it needs a comment to explain what it is.

@erikjohnston

erikjohnston Jul 11, 2017

Owner

The only time we use display name is for users... but I guess i can change it. It feels like a very odd thing to be confused about the difference between a display_name and a name (its not like its called ID or anything), especially given we've already set a precedence that we use "name" for things like this (e.g. room name)

@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

Eh, leave it as is if you insist, but I'd like to see a comment explaining what it is :)

synapse/groups/attestations.py
+
+DEFAULT_ATTESTATION_LENGTH_MS = 3 * 24 * 60 * 60 * 1000
+MIN_ATTESTATION_LENGTH_MS = 1 * 60 * 60 * 1000
+UPDATE_ATTESTATION_TIME_MS = 1 * 24 * 60 * 60 * 1000
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

Could you add some comments to explain what these numbers mean and what the effect of increasing or decreasing the would be?

synapse/groups/groups_server.py
+ @defer.inlineCallbacks
+ def get_rooms_in_group(self, group_id, requester_user_id):
+ """Get the rooms in group as seen by requester_user_id
+ """
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

Could you add a something to docstring to document the order the rooms are returned in?

+ })
+
+ @defer.inlineCallbacks
+ def add_room(self, group_id, requester_user_id, room_id, content):
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

Is this called anywhere?

erikjohnston added some commits Jul 11, 2017

+ group_id TEXT NOT NULL,
+ user_id TEXT NOT NULL,
+ is_admin BOOLEAN NOT NULL, -- whether the users membership can be seen by everyone
+ is_public BOOLEAN NOT NULL
@NegativeMjark

NegativeMjark Jul 11, 2017

Contributor

Umm. Did you put the comment on the wrong line?

LGTM apart from commenting on the purpose of the "name" column.

@erikjohnston erikjohnston changed the base branch from develop to erikj/groups_merged Jul 12, 2017

@erikjohnston erikjohnston merged commit 28e8c46 into erikj/groups_merged Jul 12, 2017

5 of 8 checks passed

Sytest Dendron (Commit) Build #2449 origin/erikj/group_server_split failed in 9 min 28 sec
Details
Sytest Postgres (Commit) Build #3286 origin/erikj/group_server_split failed in 8 min 42 sec
Details
Sytest Dendron (Merged PR) Build finished.
Details
Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Commit) Build #3372 origin/erikj/group_server_split succeeded in 1 min 47 sec
Details
Sytest SQLite (Merged PR) Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@erikjohnston erikjohnston deleted the erikj/group_server_split branch Oct 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment