Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/move-broadcastMessageFromData-to…
Browse files Browse the repository at this point in the history
…-notifyListener
  • Loading branch information
kodiakhq[bot] authored Jul 26, 2024
2 parents df1f140 + 7442ffc commit cc052b8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ jobs:
job_summary: true
comment_on_pr: false

- name: Setup kernel limits
run: |
sudo sysctl -w net.ipv4.ip_local_port_range="500 65535"
sudo sysctl -w net.ipv4.tcp_mem="383865 511820 2303190"
echo fs.file-max=20000500 | sudo tee -a /etc/sysctl.conf
echo fs.nr_open=20000500 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
- name: Login to GitHub Container Registry
if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop')
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/livechat/server/startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Meteor.startup(async () => {
});

// Remove when accounts.onLogout is async
Accounts.onLogout(({ user }: { user: IUser }) => {
Accounts.onLogout(({ user }: { user?: IUser }) => {
if (!user?.roles?.includes('livechat-agent') || user?.roles?.includes('bot')) {
return;
}
Expand Down
6 changes: 6 additions & 0 deletions apps/meteor/client/meteorOverrides/login/saml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ declare module 'meteor/accounts-base' {
credentialToken?: string;
credentialSecret?: string;
};

/**
* There is one case where the onlogout event is triggered with no user:
* during the deletion, the user is logged out, and the framework try to get the user from the database.
*/
function onLogout(func: (options: { user?: Meteor.User; connection: Meteor.Connection }) => void): void;
}
}

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/ee/server/startup/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Meteor.startup(() => {
})();
});

Accounts.onLogout((login: any): void => {
void Presence.removeConnection(login.user._id, login.connection.id, nodeId);
Accounts.onLogout((login): void => {
void Presence.removeConnection(login.user?._id, login.connection.id, nodeId);

updateConns();
});
Expand Down
5 changes: 4 additions & 1 deletion apps/meteor/server/hooks/sauMonitorHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ Accounts.onLogin((info: ILoginAttempt) => {
deviceManagementEvents.emit('device-login', eventObject);
});

Accounts.onLogout((info: { user: Meteor.User; connection: Meteor.Connection }) => {
Accounts.onLogout((info) => {
const { httpHeaders } = info.connection;

if (!info.user) {
return;
}
sauEvents.emit('accounts.logout', {
userId: info.user._id,
connection: { instanceId: InstanceStatus.id(), ...info.connection, httpHeaders: httpHeaders as IncomingHttpHeaders },
Expand Down

0 comments on commit cc052b8

Please sign in to comment.