Skip to content
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

Check dropMatrixMessagesAfterSecs just before sending to IRC #412

Merged
merged 4 commits into from
Apr 11, 2017

Conversation

kegsay
Copy link
Member

@kegsay kegsay commented Apr 11, 2017

This is to handle cases where it is set to drop messages after
5 minutes, the message arrives at 4m30s and it takes 1 minute
to go through the bridge (establish connection, join channel, etc).
Previously, the message would go through, 5m30s after the initial
send. Now, it won't go through.

Fixes issues mentioned in #388 by @justjanne

kegsay added 2 commits April 11, 2017 14:22
This is to handle cases where it is set to drop messages after
5 minutes, the message arrives at 4m30s and it takes 1 minute
to go through the bridge (establish connection, join channel, etc).
Previously, the message would go through, 5m30s after the initial
send. Now, it won't go through.
Copy link
Contributor

@lukebarnard1 lukebarnard1 left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

* @param {string} homeserverDomain : The domain of the homeserver
* e.g "matrix.org"
* @param {Number} expiryTimeSeconds : The max number of seconds a
* message can be in order for it to be sent to this server.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this makes sense. What does "a message can be" mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. e02ee95

}

/**
* Get the max number of seconds a message can be before it is dropped from
Copy link
Contributor

Choose a reason for hiding this comment

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

again, I'm not sure this is phrased well, see above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. e02ee95

let connected = false;
env.ircMock._whenClient(roomMapping.server, testUser2.nick, "connect",
function(client, cb) {
jasmine.clock().tick(20 * 1000); // advance 20s to take it over the drop time
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make it obvious that "drop time" is actually dropMatrixMessagesAfterSecs

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. e02ee95

@justjanne
Copy link

Aren't you still missing the word "old"? As in, the maximum number of seconds a message can be old before it is dropped, or the maximum age of a message before it is dropped

@kegsay
Copy link
Member Author

kegsay commented Apr 11, 2017

Yep, I've re-phrased with "old" already:

 + * @param {Number} expiryTimeSeconds : How old a matrix message can be
 + * before it is considered 'expired' and not sent to IRC. If 0, messages
 + * will never expire.

Copy link
Contributor

@lukebarnard1 lukebarnard1 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants