-
Notifications
You must be signed in to change notification settings - Fork 153
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
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
lib/irc/IrcServer.js
Outdated
* @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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. e02ee95
lib/irc/IrcServer.js
Outdated
} | ||
|
||
/** | ||
* Get the max number of seconds a message can be before it is dropped from |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. e02ee95
spec/integ/matrix-to-irc.spec.js
Outdated
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. e02ee95
Aren't you still missing the word "old"? As in, |
Yep, I've re-phrased with "old" already:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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