Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Initial Group Server #2352

Merged
merged 12 commits into from
Jul 12, 2017
Merged

Conversation

erikjohnston
Copy link
Member

No description provided.

@erikjohnston erikjohnston force-pushed the erikj/group_server_split branch from d6dba81 to b8ca494 Compare July 10, 2017 14:44
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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eitehr


@defer.inlineCallbacks
def verify_attestation(self, attestation, group_id, user_id, server_name=None):
"""Verifies that the given attestation matches the given paramaters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paramaters

group_id TEXT NOT NULL,
user_id TEXT NOT NULL,
valid_until_ms BIGINT NOT NULL,
attestation TEXT NOT NULL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should "name" be called "display_name"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@defer.inlineCallbacks
def get_rooms_in_group(self, group_id, requester_user_id):
"""Get the rooms in group as seen by requester_user_id
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this called anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is now

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

@NegativeMjark NegativeMjark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@erikjohnston erikjohnston changed the base branch from develop to erikj/groups_merged July 12, 2017 08:59
Copy link
Contributor

@NegativeMjark NegativeMjark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erikjohnston erikjohnston merged commit 28e8c46 into erikj/groups_merged Jul 12, 2017
@erikjohnston erikjohnston deleted the erikj/group_server_split branch October 26, 2017 11:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants