Skip to content

Conversation

@jesopo
Copy link

@jesopo jesopo commented Nov 2, 2022

couple of TODOs still; looking for feedback on if i'm going in the right direction

@jesopo
Copy link
Author

jesopo commented Nov 2, 2022

a more ideal future here would be one involving knocking, i.e. 60 minutes after you knock, you are invited, or something like that.

Copy link

@Yoric Yoric left a comment

Choose a reason for hiding this comment

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

As you mentioned, inviting people would probably make for better UX.

Is there a way to:

  1. First time the user knocks, send them a message along the lines of "For user safety, this bridge is configured with a join delay. You will be allowed to join on ${date}."
  2. After this delay, send an invite.

Maybe?

@jesopo
Copy link
Author

jesopo commented Nov 3, 2022

I don't believe knocking is widely implemented yet

@Yoric
Copy link

Yoric commented Nov 3, 2022

I don't believe knocking is widely implemented yet

Sorry, I shouldn't have written "knocks" but rather "attempts to join".

@jesopo jesopo marked this pull request as ready for review November 10, 2022 13:49
@jesopo jesopo requested a review from a team as a code owner November 10, 2022 13:49
Copy link
Contributor

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

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

Promising stuff, I've got some suggestions.

this.activityTracker.setLastActiveTime(userId);
this.dataStore.updateLastSeenTimeForUser(userId).catch((ex) => {
log.warn(`Failed to bump last active time for ${userId} in database`, ex);
this.dataStore.getFirstSeenTimeForUser(userId).then((when) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd make this it's own function inside datastore personally, and have the logic for setting first seen time handled within. We might even be able to wrap the postgres stuff into one statement.

user.getId(),
req,
true,
`Please wait ${remaining} seconds`,
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably need to let the user know why they are waiting :). Either a message to their admin room, or a link to a page.

inactiveAfterDays?: number;
};
banLists?: MatrixBanSyncConfig;
delayBridging?: {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these need more descriptions about what they do. It might even make sense to have this go under the membershipLists configuration where we configure Matrix joins.

We should certainly make it obvious that these are seconds.

ALTER TABLE last_seen ADD COLUMN first BIGINT;
ALTER TABLE last_seen RENAME COLUMN ts TO last;
UPDATE last_seen SET first = last;
ALTER TABLE last_seen ALTER COLUMN first SET 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.

That might explode for all the existing items that don't have a value set.

Copy link
Author

Choose a reason for hiding this comment

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

see the line above it; we backfill first from last

@Half-Shot Half-Shot self-requested a review December 5, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants