diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel
index b077d0c22572..fd58ea4d1217 100644
--- a/.docker/Dockerfile.rhel
+++ b/.docker/Dockerfile.rhel
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/ubi8/nodejs-12
-ENV RC_VERSION 4.6.1
+ENV RC_VERSION 4.6.2
MAINTAINER buildmaster@rocket.chat
diff --git a/.github/history.json b/.github/history.json
index bad96d554e63..57a3e4f48887 100644
--- a/.github/history.json
+++ b/.github/history.json
@@ -73134,6 +73134,108 @@
]
}
]
+ },
+ "4.4.3": {
+ "node_version": "14.18.2",
+ "npm_version": "6.14.15",
+ "apps_engine_version": "1.30.0",
+ "mongo_versions": [
+ "3.6",
+ "4.0",
+ "4.2",
+ "4.4",
+ "5.0"
+ ],
+ "pull_requests": [
+ {
+ "pr": "25022",
+ "title": "[FIX] Proxy settings being ignored",
+ "userLogin": "pierre-lehnen-rc",
+ "description": "Modify Meteor's `HTTP.call` to add back proxy support",
+ "milestone": "4.6.1",
+ "contributors": [
+ "pierre-lehnen-rc",
+ "sampaiodiego"
+ ]
+ },
+ {
+ "pr": "25067",
+ "title": "[FIX] NPS never finishing sending results",
+ "userLogin": "sampaiodiego",
+ "milestone": "4.6.1",
+ "contributors": [
+ "sampaiodiego"
+ ]
+ }
+ ]
+ },
+ "4.5.6": {
+ "node_version": "14.18.3",
+ "npm_version": "6.14.15",
+ "apps_engine_version": "1.31.0",
+ "mongo_versions": [
+ "3.6",
+ "4.0",
+ "4.2",
+ "4.4",
+ "5.0"
+ ],
+ "pull_requests": [
+ {
+ "pr": "25022",
+ "title": "[FIX] Proxy settings being ignored",
+ "userLogin": "pierre-lehnen-rc",
+ "description": "Modify Meteor's `HTTP.call` to add back proxy support",
+ "milestone": "4.6.1",
+ "contributors": [
+ "pierre-lehnen-rc",
+ "sampaiodiego"
+ ]
+ },
+ {
+ "pr": "25067",
+ "title": "[FIX] NPS never finishing sending results",
+ "userLogin": "sampaiodiego",
+ "milestone": "4.6.1",
+ "contributors": [
+ "sampaiodiego"
+ ]
+ }
+ ]
+ },
+ "4.6.2": {
+ "node_version": "14.18.3",
+ "npm_version": "6.14.15",
+ "apps_engine_version": "1.31.0",
+ "mongo_versions": [
+ "3.6",
+ "4.0",
+ "4.2",
+ "4.4",
+ "5.0"
+ ],
+ "pull_requests": [
+ {
+ "pr": "25101",
+ "title": "[FIX] Database indexes not being created",
+ "userLogin": "sampaiodiego",
+ "milestone": "4.6.2",
+ "contributors": [
+ "sampaiodiego"
+ ]
+ },
+ {
+ "pr": "24933",
+ "title": "[FIX] Deactivating user breaks if user is the only room owner",
+ "userLogin": "sidmohanty11",
+ "description": "## Before\r\n\r\nhttps://user-images.githubusercontent.com/73601258/160000871-cfc2f2a5-2a59-4d27-8049-7754d003dd48.mp4\r\n\r\n\r\n\r\n## After\r\nhttps://user-images.githubusercontent.com/73601258/159998287-681ab475-ff33-4282-82ff-db751c59a392.mp4",
+ "milestone": "4.6.2",
+ "contributors": [
+ "sidmohanty11",
+ "sampaiodiego"
+ ]
+ }
+ ]
}
}
}
\ No newline at end of file
diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat
index 02512553a35e..1ed4a49c6519 100755
--- a/.snapcraft/resources/prepareRocketChat
+++ b/.snapcraft/resources/prepareRocketChat
@@ -1,6 +1,6 @@
#!/bin/bash
-curl -SLf "https://releases.rocket.chat/4.6.1/download/" -o rocket.chat.tgz
+curl -SLf "https://releases.rocket.chat/4.6.2/download/" -o rocket.chat.tgz
tar xf rocket.chat.tgz --strip 1
diff --git a/.snapcraft/snap/snapcraft.yaml b/.snapcraft/snap/snapcraft.yaml
index 8ff721e3afd7..9556f335e447 100644
--- a/.snapcraft/snap/snapcraft.yaml
+++ b/.snapcraft/snap/snapcraft.yaml
@@ -7,7 +7,7 @@
# 5. `snapcraft snap`
name: rocketchat-server
-version: 4.6.1
+version: 4.6.2
summary: Rocket.Chat server
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
confinement: strict
diff --git a/HISTORY.md b/HISTORY.md
index e72197f75fcb..600fce293add 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,4 +1,37 @@
+# 4.6.2
+`2022-04-14 ยท 2 ๐ ยท 2 ๐ฉโ๐ป๐จโ๐ป`
+
+### Engine versions
+- Node: `14.18.3`
+- NPM: `6.14.15`
+- MongoDB: `3.6, 4.0, 4.2, 4.4, 5.0`
+- Apps-Engine: `1.31.0`
+
+### ๐ Bug fixes
+
+
+- Database indexes not being created ([#25101](https://github.com/RocketChat/Rocket.Chat/pull/25101))
+
+- Deactivating user breaks if user is the only room owner ([#24933](https://github.com/RocketChat/Rocket.Chat/pull/24933) by [@sidmohanty11](https://github.com/sidmohanty11))
+
+ ## Before
+
+ https://user-images.githubusercontent.com/73601258/160000871-cfc2f2a5-2a59-4d27-8049-7754d003dd48.mp4
+
+
+
+ ## After
+ https://user-images.githubusercontent.com/73601258/159998287-681ab475-ff33-4282-82ff-db751c59a392.mp4
+
+### ๐ฉโ๐ป๐จโ๐ป Contributors ๐
+
+- [@sidmohanty11](https://github.com/sidmohanty11)
+
+### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
+
+- [@sampaiodiego](https://github.com/sampaiodiego)
+
# 4.6.1
`2022-04-07 ยท 6 ๐ ยท 5 ๐ฉโ๐ป๐จโ๐ป`
@@ -51,7 +84,7 @@
### ๐ New features
-- Telemetry Events ([#24781](https://github.com/RocketChat/Rocket.Chat/pull/24781) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- Telemetry Events ([#24781](https://github.com/RocketChat/Rocket.Chat/pull/24781) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
- Upgrade Tab ([#24835](https://github.com/RocketChat/Rocket.Chat/pull/24835))
@@ -119,7 +152,7 @@
- Apple OAuth ([#24879](https://github.com/RocketChat/Rocket.Chat/pull/24879))
-- auto-join team channels not honoring user preferences ([#24779](https://github.com/RocketChat/Rocket.Chat/pull/24779))
+- auto-join team channels not honoring user preferences ([#24779](https://github.com/RocketChat/Rocket.Chat/pull/24779) by [@ostjen](https://github.com/ostjen))
- Broken build caused by PRs modifying same file differently ([#24863](https://github.com/RocketChat/Rocket.Chat/pull/24863))
@@ -430,6 +463,7 @@
- [@dependabot[bot]](https://github.com/dependabot[bot])
- [@eduardofcabrera](https://github.com/eduardofcabrera)
- [@nishant23122000](https://github.com/nishant23122000)
+- [@ostjen](https://github.com/ostjen)
- [@tkurz](https://github.com/tkurz)
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
@@ -450,7 +484,6 @@
- [@juliajforesti](https://github.com/juliajforesti)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@rodrigok](https://github.com/rodrigok)
@@ -459,6 +492,29 @@
- [@tiagoevanp](https://github.com/tiagoevanp)
- [@yash-rajpal](https://github.com/yash-rajpal)
+# 4.5.6
+`2022-04-07 ยท 2 ๐ ยท 2 ๐ฉโ๐ป๐จโ๐ป`
+
+### Engine versions
+- Node: `14.18.3`
+- NPM: `6.14.15`
+- MongoDB: `3.6, 4.0, 4.2, 4.4, 5.0`
+- Apps-Engine: `1.31.0`
+
+### ๐ Bug fixes
+
+
+- NPS never finishing sending results ([#25067](https://github.com/RocketChat/Rocket.Chat/pull/25067))
+
+- Proxy settings being ignored ([#25022](https://github.com/RocketChat/Rocket.Chat/pull/25022))
+
+ Modify Meteor's `HTTP.call` to add back proxy support
+
+### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
+
+- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
+- [@sampaiodiego](https://github.com/sampaiodiego)
+
# 4.5.5
`2022-03-30 ยท 2 ๐ ยท 2 ๐ ยท 6 ๐ฉโ๐ป๐จโ๐ป`
@@ -730,7 +786,7 @@
### ๐ New features
-- E2E password generator ([#24114](https://github.com/RocketChat/Rocket.Chat/pull/24114) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- E2E password generator ([#24114](https://github.com/RocketChat/Rocket.Chat/pull/24114) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
- Marketplace sort filter ([#24567](https://github.com/RocketChat/Rocket.Chat/pull/24567))
@@ -779,14 +835,14 @@
Users can now feel more encouraged to use these actions knowing what they are supposed to do.
-- Add user to room on "Click to Join!" button press ([#24041](https://github.com/RocketChat/Rocket.Chat/pull/24041))
+- Add user to room on "Click to Join!" button press ([#24041](https://github.com/RocketChat/Rocket.Chat/pull/24041) by [@ostjen](https://github.com/ostjen))
- Add user to room on "Click to Join!" button press;
- Display the "Join" button in discussions inside channels (keeping the behavior consistent with discussions inside groups).
- Added a new "All" tab which shows all integrations in Integrations ([#24109](https://github.com/RocketChat/Rocket.Chat/pull/24109) by [@aswinidev](https://github.com/aswinidev))
-- ChatBox Text to File Description ([#24451](https://github.com/RocketChat/Rocket.Chat/pull/24451) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- ChatBox Text to File Description ([#24451](https://github.com/RocketChat/Rocket.Chat/pull/24451) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
The text content from chatbox goes to the file description when drag and drop a file.
@@ -835,7 +891,7 @@
Currently Slash Commands don't work in an E2EE room, as we encrypt the message before slash command is detected by the server, So removed encryption for slash commands in e2e rooms.
-- Team system messages feedback ([#24209](https://github.com/RocketChat/Rocket.Chat/pull/24209))
+- Team system messages feedback ([#24209](https://github.com/RocketChat/Rocket.Chat/pull/24209) by [@ostjen](https://github.com/ostjen))
- Delete some keys that aren't being used (eg: User_left_female).
- Add new Teams' system messages:
@@ -859,7 +915,7 @@
- Implement client errors on ddp-streamer ([#24310](https://github.com/RocketChat/Rocket.Chat/pull/24310))
-- Inconsistent validation of user's access to rooms ([#24037](https://github.com/RocketChat/Rocket.Chat/pull/24037))
+- Inconsistent validation of user's access to rooms ([#24037](https://github.com/RocketChat/Rocket.Chat/pull/24037) by [@ostjen](https://github.com/ostjen))
- Issues on selecting users when importing CSV ([#24253](https://github.com/RocketChat/Rocket.Chat/pull/24253))
@@ -889,7 +945,7 @@
- Skip cloud steps for registered servers on setup wizard ([#24407](https://github.com/RocketChat/Rocket.Chat/pull/24407))
-- Slash commands previews not working ([#24387](https://github.com/RocketChat/Rocket.Chat/pull/24387))
+- Slash commands previews not working ([#24387](https://github.com/RocketChat/Rocket.Chat/pull/24387) by [@ostjen](https://github.com/ostjen))
- Startup errors creating indexes ([#24409](https://github.com/RocketChat/Rocket.Chat/pull/24409))
@@ -949,23 +1005,23 @@
This pull request converts 26 more files from Javascript to Typescript, to check variable types and increase validation on the code.
-- Chore: Convert to typescript the me slashCommands files ([#24321](https://github.com/RocketChat/Rocket.Chat/pull/24321) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- Chore: Convert to typescript the me slashCommands files ([#24321](https://github.com/RocketChat/Rocket.Chat/pull/24321) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
Convert to typescript the me slashCommands files
-- Chore: Convert to typescript the mute and unmute slash commands files ([#24325](https://github.com/RocketChat/Rocket.Chat/pull/24325) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- Chore: Convert to typescript the mute and unmute slash commands files ([#24325](https://github.com/RocketChat/Rocket.Chat/pull/24325) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
Convert to typescript the mute and unmute slash commands files
-- Chore: Convert to typescript the slash commands create files ([#24306](https://github.com/RocketChat/Rocket.Chat/pull/24306) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- Chore: Convert to typescript the slash commands create files ([#24306](https://github.com/RocketChat/Rocket.Chat/pull/24306) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
Convert Slash Commands create files to typescript.
-- Chore: Convert to typescript the slash commands invite files ([#24311](https://github.com/RocketChat/Rocket.Chat/pull/24311) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- Chore: Convert to typescript the slash commands invite files ([#24311](https://github.com/RocketChat/Rocket.Chat/pull/24311) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
Convert to typescript the slash commands invite files
-- Chore: Convert to typescript the unarchive slash commands files ([#24331](https://github.com/RocketChat/Rocket.Chat/pull/24331) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- Chore: Convert to typescript the unarchive slash commands files ([#24331](https://github.com/RocketChat/Rocket.Chat/pull/24331) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
Convert to typescript the unarchive slash commands files
@@ -1090,6 +1146,7 @@
- [@aswinidev](https://github.com/aswinidev)
- [@dependabot[bot]](https://github.com/dependabot[bot])
- [@eduardofcabrera](https://github.com/eduardofcabrera)
+- [@ostjen](https://github.com/ostjen)
- [@pedrogssouza](https://github.com/pedrogssouza)
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
@@ -1109,7 +1166,6 @@
- [@juliajforesti](https://github.com/juliajforesti)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@rique223](https://github.com/rique223)
@@ -1120,6 +1176,29 @@
- [@ujorgeleite](https://github.com/ujorgeleite)
- [@yash-rajpal](https://github.com/yash-rajpal)
+# 4.4.3
+`2022-04-07 ยท 2 ๐ ยท 2 ๐ฉโ๐ป๐จโ๐ป`
+
+### Engine versions
+- Node: `14.18.2`
+- NPM: `6.14.15`
+- MongoDB: `3.6, 4.0, 4.2, 4.4, 5.0`
+- Apps-Engine: `1.30.0`
+
+### ๐ Bug fixes
+
+
+- NPS never finishing sending results ([#25067](https://github.com/RocketChat/Rocket.Chat/pull/25067))
+
+- Proxy settings being ignored ([#25022](https://github.com/RocketChat/Rocket.Chat/pull/25022))
+
+ Modify Meteor's `HTTP.call` to add back proxy support
+
+### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
+
+- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
+- [@sampaiodiego](https://github.com/sampaiodiego)
+
# 4.4.2
`2022-02-09 ยท 1 ๐ ยท 2 ๐ ยท 3 ๐ฉโ๐ป๐จโ๐ป`
@@ -1170,7 +1249,7 @@
- Skip cloud steps for registered servers on setup wizard ([#24407](https://github.com/RocketChat/Rocket.Chat/pull/24407))
-- Slash commands previews not working ([#24387](https://github.com/RocketChat/Rocket.Chat/pull/24387))
+- Slash commands previews not working ([#24387](https://github.com/RocketChat/Rocket.Chat/pull/24387) by [@ostjen](https://github.com/ostjen))
- Startup errors creating indexes ([#24409](https://github.com/RocketChat/Rocket.Chat/pull/24409))
@@ -1180,15 +1259,18 @@
๐ Minor changes
-- Release 4.4.1 ([#24432](https://github.com/RocketChat/Rocket.Chat/pull/24432))
+- Release 4.4.1 ([#24432](https://github.com/RocketChat/Rocket.Chat/pull/24432) by [@ostjen](https://github.com/ostjen))
+### ๐ฉโ๐ป๐จโ๐ป Contributors ๐
+
+- [@ostjen](https://github.com/ostjen)
+
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
- [@dougfabris](https://github.com/dougfabris)
- [@gabriellsh](https://github.com/gabriellsh)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@sampaiodiego](https://github.com/sampaiodiego)
- [@tassoevan](https://github.com/tassoevan)
@@ -1249,9 +1331,9 @@
![Screen Shot 2022-01-13 at 13 38 59](https://user-images.githubusercontent.com/27704687/149371232-3d292f5e-e8b0-41e1-b065-90a80a5f08ce.png)
![Screen Shot 2022-01-13 at 13 39 08](https://user-images.githubusercontent.com/27704687/149371263-64fd09e4-456e-48ee-9976-83f42b90e4d9.png)
-- Importer text for CSV upload file format ([#23817](https://github.com/RocketChat/Rocket.Chat/pull/23817))
+- Importer text for CSV upload file format ([#23817](https://github.com/RocketChat/Rocket.Chat/pull/23817) by [@ostjen](https://github.com/ostjen))
-- lib/Statistics improved and metrics collector ([#24177](https://github.com/RocketChat/Rocket.Chat/pull/24177))
+- lib/Statistics improved and metrics collector ([#24177](https://github.com/RocketChat/Rocket.Chat/pull/24177) by [@ostjen](https://github.com/ostjen))
- On `statistics` object the property `get` is an async function now.
- We need to collect additional data of feature activation through the statistics collector.
@@ -1371,7 +1453,7 @@
Right now, if we try to press enter for a new line on multi-line modal input... it auto triggers the submit event. This PR fixes this behaviour by not submitting the modal in case the enter was pressed within an input text with multiline expected
-- Errors on advanced sync prevent LDAP users from logging in ([#23958](https://github.com/RocketChat/Rocket.Chat/pull/23958))
+- Errors on advanced sync prevent LDAP users from logging in ([#23958](https://github.com/RocketChat/Rocket.Chat/pull/23958) by [@ostjen](https://github.com/ostjen))
- Filter ability for admin room checkboxes ([#23970](https://github.com/RocketChat/Rocket.Chat/pull/23970) by [@sidmohanty11](https://github.com/sidmohanty11))
@@ -1461,7 +1543,7 @@
It replaces some templates used by login and invitation flows with React components. It also drops `main` template, allowing `appLayout` to just handle components now.
-- Chore: Slash Commands Join to Typescript ([#24254](https://github.com/RocketChat/Rocket.Chat/pull/24254) by [@eduardofcabrera](https://github.com/eduardofcabrera))
+- Chore: Slash Commands Join to Typescript ([#24254](https://github.com/RocketChat/Rocket.Chat/pull/24254) by [@eduardofcabrera](https://github.com/eduardofcabrera) & [@ostjen](https://github.com/ostjen))
Convert the slash commands .js files to .ts files.
@@ -1546,6 +1628,7 @@
- [@grahhnt](https://github.com/grahhnt)
- [@mbreslein-thd](https://github.com/mbreslein-thd)
- [@nishant23122000](https://github.com/nishant23122000)
+- [@ostjen](https://github.com/ostjen)
- [@sidmohanty11](https://github.com/sidmohanty11)
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
@@ -1564,7 +1647,6 @@
- [@juliajforesti](https://github.com/juliajforesti)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@rique223](https://github.com/rique223)
@@ -1788,7 +1870,7 @@
- DMs being created with username instead of user's name ([#23848](https://github.com/RocketChat/Rocket.Chat/pull/23848))
-- Email notifications settings not being honored on new DMs ([#23574](https://github.com/RocketChat/Rocket.Chat/pull/23574))
+- Email notifications settings not being honored on new DMs ([#23574](https://github.com/RocketChat/Rocket.Chat/pull/23574) by [@ostjen](https://github.com/ostjen))
- Error when creating an inactive user in admin panel ([#23859](https://github.com/RocketChat/Rocket.Chat/pull/23859))
@@ -1892,7 +1974,7 @@
- Bump thehanimo/pr-title-checker from 1.2 to 1.3.4 ([#23853](https://github.com/RocketChat/Rocket.Chat/pull/23853) by [@dependabot[bot]](https://github.com/dependabot[bot]))
-- Chore: added last login to users.list ([#23846](https://github.com/RocketChat/Rocket.Chat/pull/23846))
+- Chore: added last login to users.list ([#23846](https://github.com/RocketChat/Rocket.Chat/pull/23846) by [@ostjen](https://github.com/ostjen))
- Chore: Bump fuselage 0.31.0 ([#24046](https://github.com/RocketChat/Rocket.Chat/pull/24046))
@@ -1908,7 +1990,7 @@
- Create NPM script to add new migrations
- TODO: Infer next migration number from file list
-- Chore: Deleted LivechatPageVisited ([#23993](https://github.com/RocketChat/Rocket.Chat/pull/23993))
+- Chore: Deleted LivechatPageVisited ([#23993](https://github.com/RocketChat/Rocket.Chat/pull/23993) by [@ostjen](https://github.com/ostjen))
- Chore: Enable prefer-optional-chain ESLint rule for TypeScript files ([#23786](https://github.com/RocketChat/Rocket.Chat/pull/23786))
@@ -2008,6 +2090,7 @@
- [@aswinidev](https://github.com/aswinidev)
- [@dependabot[bot]](https://github.com/dependabot[bot])
- [@goyome](https://github.com/goyome)
+- [@ostjen](https://github.com/ostjen)
- [@qwertiko](https://github.com/qwertiko)
- [@rafaelblink](https://github.com/rafaelblink)
- [@sidmohanty11](https://github.com/sidmohanty11)
@@ -2026,7 +2109,6 @@
- [@juliajforesti](https://github.com/juliajforesti)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@rique223](https://github.com/rique223)
@@ -2145,13 +2227,13 @@
Open the Enterprise LDAP API that executes background sync to be used without any Enterprise License and enforce 2FA requirements.
-- Permission for download/uploading files on mobile ([#23686](https://github.com/RocketChat/Rocket.Chat/pull/23686))
+- Permission for download/uploading files on mobile ([#23686](https://github.com/RocketChat/Rocket.Chat/pull/23686) by [@ostjen](https://github.com/ostjen))
- Permissions for interacting with Omnichannel Contact Center ([#23389](https://github.com/RocketChat/Rocket.Chat/pull/23389))
Adds a new permission, one that allows for control over user access to Omnichannel Contact Center,
-- Rate limiting for user registering ([#23732](https://github.com/RocketChat/Rocket.Chat/pull/23732))
+- Rate limiting for user registering ([#23732](https://github.com/RocketChat/Rocket.Chat/pull/23732) by [@ostjen](https://github.com/ostjen))
- REST endpoints to manage Omnichannel Business Units ([#23750](https://github.com/RocketChat/Rocket.Chat/pull/23750))
@@ -2208,7 +2290,7 @@
### ๐ Bug fixes
-- "to users" not working in export message ([#23576](https://github.com/RocketChat/Rocket.Chat/pull/23576))
+- "to users" not working in export message ([#23576](https://github.com/RocketChat/Rocket.Chat/pull/23576) by [@ostjen](https://github.com/ostjen))
- **ENTERPRISE:** OAuth "Merge Roles" removes roles from users ([#23588](https://github.com/RocketChat/Rocket.Chat/pull/23588))
@@ -2248,7 +2330,7 @@
- Fix typo in FR translation ([#23711](https://github.com/RocketChat/Rocket.Chat/pull/23711) by [@Cormoran96](https://github.com/Cormoran96))
-- Fixed E2E default room settings not being honoured ([#23468](https://github.com/RocketChat/Rocket.Chat/pull/23468) by [@TheDigitalEagle](https://github.com/TheDigitalEagle))
+- Fixed E2E default room settings not being honoured ([#23468](https://github.com/RocketChat/Rocket.Chat/pull/23468) by [@TheDigitalEagle](https://github.com/TheDigitalEagle) & [@ostjen](https://github.com/ostjen))
- LDAP users being disabled when an AD security policy is enabled ([#23820](https://github.com/RocketChat/Rocket.Chat/pull/23820))
@@ -2288,7 +2370,7 @@
When you take an Omnichannel chat from queue, the guest's typing information will appear.
-- Registration not possible when any user is blocked for multiple failed logins ([#23565](https://github.com/RocketChat/Rocket.Chat/pull/23565))
+- Registration not possible when any user is blocked for multiple failed logins ([#23565](https://github.com/RocketChat/Rocket.Chat/pull/23565) by [@ostjen](https://github.com/ostjen))
๐ Minor changes
@@ -2389,6 +2471,7 @@
- [@TheDigitalEagle](https://github.com/TheDigitalEagle)
- [@bhardwajaditya](https://github.com/bhardwajaditya)
- [@dhruvjain99](https://github.com/dhruvjain99)
+- [@ostjen](https://github.com/ostjen)
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
@@ -2402,7 +2485,6 @@
- [@ggazzo](https://github.com/ggazzo)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@rodrigok](https://github.com/rodrigok)
@@ -2494,7 +2576,7 @@
Since now we're supporting markdown text on this field (via this PR - https://github.com/RocketChat/Rocket.Chat.Livechat/pull/648), it would be nice to make this setting multiline so users can have more space to edit the text
![image](https://user-images.githubusercontent.com/34130764/138146712-13e4968b-5312-4d53-b44c-b5699c5e49c1.png)
-- optimized groups.listAll response time ([#22941](https://github.com/RocketChat/Rocket.Chat/pull/22941))
+- optimized groups.listAll response time ([#22941](https://github.com/RocketChat/Rocket.Chat/pull/22941) by [@ostjen](https://github.com/ostjen))
groups.listAll endpoint was having performance issues, specially when the total number of groups was high. This happened because the endpoint was loading all objects in memory then using splice to paginate, instead of paginating beforehand.
@@ -2522,7 +2604,7 @@
- Attachment buttons overlap in mobile view ([#23377](https://github.com/RocketChat/Rocket.Chat/pull/23377) by [@Aman-Maheshwari](https://github.com/Aman-Maheshwari))
-- Avoid last admin deactivate itself ([#22949](https://github.com/RocketChat/Rocket.Chat/pull/22949))
+- Avoid last admin deactivate itself ([#22949](https://github.com/RocketChat/Rocket.Chat/pull/22949) by [@ostjen](https://github.com/ostjen))
Co-authored-by: @Kartik18g
@@ -2532,7 +2614,7 @@
- Delay start of email inbox ([#23521](https://github.com/RocketChat/Rocket.Chat/pull/23521))
-- imported migration v240 ([#23374](https://github.com/RocketChat/Rocket.Chat/pull/23374))
+- imported migration v240 ([#23374](https://github.com/RocketChat/Rocket.Chat/pull/23374) by [@ostjen](https://github.com/ostjen))
- LDAP not stoping after wrong password ([#23382](https://github.com/RocketChat/Rocket.Chat/pull/23382))
@@ -2575,7 +2657,7 @@
- Server crashing when Routing method is not available at start ([#23473](https://github.com/RocketChat/Rocket.Chat/pull/23473))
-- unwanted toastr error message when deleting user ([#23372](https://github.com/RocketChat/Rocket.Chat/pull/23372))
+- unwanted toastr error message when deleting user ([#23372](https://github.com/RocketChat/Rocket.Chat/pull/23372) by [@ostjen](https://github.com/ostjen))
- useEndpointAction replace by useEndpointActionExperimental ([#23469](https://github.com/RocketChat/Rocket.Chat/pull/23469))
@@ -2710,6 +2792,7 @@
- [@badbart](https://github.com/badbart)
- [@cuonghuunguyen](https://github.com/cuonghuunguyen)
- [@dependabot[bot]](https://github.com/dependabot[bot])
+- [@ostjen](https://github.com/ostjen)
- [@wolbernd](https://github.com/wolbernd)
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
@@ -2723,7 +2806,6 @@
- [@ggazzo](https://github.com/ggazzo)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@rodrigok](https://github.com/rodrigok)
- [@sampaiodiego](https://github.com/sampaiodiego)
@@ -2883,7 +2965,7 @@
Fixes BigBlueButton integration
-- imported migration v240 ([#23374](https://github.com/RocketChat/Rocket.Chat/pull/23374))
+- imported migration v240 ([#23374](https://github.com/RocketChat/Rocket.Chat/pull/23374) by [@ostjen](https://github.com/ostjen))
- LDAP not stoping after wrong password ([#23382](https://github.com/RocketChat/Rocket.Chat/pull/23382))
@@ -2891,7 +2973,7 @@
- resumeToken not working ([#23379](https://github.com/RocketChat/Rocket.Chat/pull/23379))
-- unwanted toastr error message when deleting user ([#23372](https://github.com/RocketChat/Rocket.Chat/pull/23372))
+- unwanted toastr error message when deleting user ([#23372](https://github.com/RocketChat/Rocket.Chat/pull/23372) by [@ostjen](https://github.com/ostjen))
- Users' `roles` and `type` being reset to default on LDAP DataSync ([#23378](https://github.com/RocketChat/Rocket.Chat/pull/23378))
@@ -2903,19 +2985,19 @@
- Chore: Update Apps-Engine version ([#23375](https://github.com/RocketChat/Rocket.Chat/pull/23375))
-- Release 4.0.1 ([#23386](https://github.com/RocketChat/Rocket.Chat/pull/23386) by [@wolbernd](https://github.com/wolbernd))
+- Release 4.0.1 ([#23386](https://github.com/RocketChat/Rocket.Chat/pull/23386) by [@ostjen](https://github.com/ostjen) & [@wolbernd](https://github.com/wolbernd))
### ๐ฉโ๐ป๐จโ๐ป Contributors ๐
+- [@ostjen](https://github.com/ostjen)
- [@wolbernd](https://github.com/wolbernd)
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
- [@d-gubert](https://github.com/d-gubert)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
-- [@ostjen](https://github.com/ostjen)
- [@rodrigok](https://github.com/rodrigok)
- [@sampaiodiego](https://github.com/sampaiodiego)
- [@tassoevan](https://github.com/tassoevan)
@@ -2950,13 +3032,13 @@
- LDAP Refactoring ([#23171](https://github.com/RocketChat/Rocket.Chat/pull/23171))
-- Moved advanced oAuth features to EE ([#23201](https://github.com/RocketChat/Rocket.Chat/pull/23201))
+- Moved advanced oAuth features to EE ([#23201](https://github.com/RocketChat/Rocket.Chat/pull/23201) by [@ostjen](https://github.com/ostjen))
-- Moved role-sync and advanced SAML settings to EE ([#23107](https://github.com/RocketChat/Rocket.Chat/pull/23107))
+- Moved role-sync and advanced SAML settings to EE ([#23107](https://github.com/RocketChat/Rocket.Chat/pull/23107) by [@ostjen](https://github.com/ostjen))
-- Moved SAML custom field map to EE ([#23319](https://github.com/RocketChat/Rocket.Chat/pull/23319))
+- Moved SAML custom field map to EE ([#23319](https://github.com/RocketChat/Rocket.Chat/pull/23319) by [@ostjen](https://github.com/ostjen))
-- Remove cordova compatibility setting ([#23302](https://github.com/RocketChat/Rocket.Chat/pull/23302))
+- Remove cordova compatibility setting ([#23302](https://github.com/RocketChat/Rocket.Chat/pull/23302) by [@ostjen](https://github.com/ostjen))
- Remove deprecated endpoints ([#23162](https://github.com/RocketChat/Rocket.Chat/pull/23162))
@@ -2985,7 +3067,7 @@
- Remove patch info from endpoint /api/info for non-logged in users ([#16050](https://github.com/RocketChat/Rocket.Chat/pull/16050))
-- Removed support of MongoDB 3.4; Deprecated MongoDB 3.6 and 4.0 ([#22907](https://github.com/RocketChat/Rocket.Chat/pull/22907))
+- Removed support of MongoDB 3.4; Deprecated MongoDB 3.6 and 4.0 ([#22907](https://github.com/RocketChat/Rocket.Chat/pull/22907) by [@ostjen](https://github.com/ostjen))
- Stop sending audio notifications via stream ([#23108](https://github.com/RocketChat/Rocket.Chat/pull/23108))
@@ -3083,7 +3165,7 @@
- Use `encodeURIComponent()` to encode values received by `_generateQueryFromParams()`.
-- "Read Only" and "Allow Reacting" system messages are missing in rooms ([#23037](https://github.com/RocketChat/Rocket.Chat/pull/23037))
+- "Read Only" and "Allow Reacting" system messages are missing in rooms ([#23037](https://github.com/RocketChat/Rocket.Chat/pull/23037) by [@ostjen](https://github.com/ostjen))
- Add system message to notify changes on the **"Read Only"** setting;
- Add system message to notify changes on the **"Allow Reacting"** setting;
@@ -3100,7 +3182,7 @@
- Check which fields have been updated before throwing errors in `validateUserEditing`.
-- Inaccurate use of 'Mobile notifications' instead of 'Push notifications' in i18n strings ([#22978](https://github.com/RocketChat/Rocket.Chat/pull/22978))
+- Inaccurate use of 'Mobile notifications' instead of 'Push notifications' in i18n strings ([#22978](https://github.com/RocketChat/Rocket.Chat/pull/22978) by [@ostjen](https://github.com/ostjen))
- Fix inaccurate use of 'Mobile notifications' (which is misleading in German) by 'Push notifications';
- Update `'Notification_Mobile_Default_For'` key to `'Notification_Push_Default_For'` (and text to 'Send Push Notifications For' for English Language);
@@ -3159,7 +3241,7 @@
- Update bugsnag package ([#23104](https://github.com/RocketChat/Rocket.Chat/pull/23104))
-- User list not being updated after creation/deletion of user ([#23032](https://github.com/RocketChat/Rocket.Chat/pull/23032))
+- User list not being updated after creation/deletion of user ([#23032](https://github.com/RocketChat/Rocket.Chat/pull/23032) by [@ostjen](https://github.com/ostjen))
- Wrap canned-responses endpoints with ee license ([#23204](https://github.com/RocketChat/Rocket.Chat/pull/23204))
@@ -3302,7 +3384,7 @@
Spotted by @gabriellsh.
-- Regression: Removed exclusive tests statement ([#23333](https://github.com/RocketChat/Rocket.Chat/pull/23333))
+- Regression: Removed exclusive tests statement ([#23333](https://github.com/RocketChat/Rocket.Chat/pull/23333) by [@ostjen](https://github.com/ostjen))
- Regression: Request seats link ([#23312](https://github.com/RocketChat/Rocket.Chat/pull/23312))
@@ -3331,6 +3413,7 @@
- [@g-thome](https://github.com/g-thome)
- [@gabrieloliverio](https://github.com/gabrieloliverio)
- [@lucassartor](https://github.com/lucassartor)
+- [@ostjen](https://github.com/ostjen)
- [@sumukhah](https://github.com/sumukhah)
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
@@ -3347,7 +3430,6 @@
- [@graywolf336](https://github.com/graywolf336)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@rodrigok](https://github.com/rodrigok)
@@ -3513,15 +3595,15 @@
- Bad words falling if message is empty ([#22930](https://github.com/RocketChat/Rocket.Chat/pull/22930))
-- Broken download link on uploaded files ([#22848](https://github.com/RocketChat/Rocket.Chat/pull/22848))
+- Broken download link on uploaded files ([#22848](https://github.com/RocketChat/Rocket.Chat/pull/22848) by [@ostjen](https://github.com/ostjen))
Uploaded files had wrong download links when the deploy had a sub directory. This misbehavior was caused by the wrong usage of the rtrim method, the 2nd parameter is a list of chars, [not a string](https://www.php.net/manual/pt_BR/function.rtrim.php) (this method was inspired by php)
-- Can't access other administration menus after opening Engagement Dashboard ([#22870](https://github.com/RocketChat/Rocket.Chat/pull/22870))
+- Can't access other administration menus after opening Engagement Dashboard ([#22870](https://github.com/RocketChat/Rocket.Chat/pull/22870) by [@ostjen](https://github.com/ostjen))
-- Go command duplicating subfolder path on iframes. ([#22796](https://github.com/RocketChat/Rocket.Chat/pull/22796))
+- Go command duplicating subfolder path on iframes. ([#22796](https://github.com/RocketChat/Rocket.Chat/pull/22796) by [@ostjen](https://github.com/ostjen))
-- Manually approve new users is not applied to SAML users ([#22823](https://github.com/RocketChat/Rocket.Chat/pull/22823))
+- Manually approve new users is not applied to SAML users ([#22823](https://github.com/RocketChat/Rocket.Chat/pull/22823) by [@ostjen](https://github.com/ostjen))
- Production-environment dependencies ([#22868](https://github.com/RocketChat/Rocket.Chat/pull/22868))
@@ -3529,7 +3611,7 @@
- QuickActions for mobile screen ([#23016](https://github.com/RocketChat/Rocket.Chat/pull/23016))
-- Registration not possible with TOTP and email verification ([#22778](https://github.com/RocketChat/Rocket.Chat/pull/22778))
+- Registration not possible with TOTP and email verification ([#22778](https://github.com/RocketChat/Rocket.Chat/pull/22778) by [@ostjen](https://github.com/ostjen))
- Return transcript/dashboards based on timezone settings ([#22850](https://github.com/RocketChat/Rocket.Chat/pull/22850))
@@ -3554,7 +3636,7 @@
- TypeError on Callout type prop ([#22790](https://github.com/RocketChat/Rocket.Chat/pull/22790) by [@hrahul2605](https://github.com/hrahul2605))
-- User is still asked for 2FA confirmation even if it is deactivated ([#22801](https://github.com/RocketChat/Rocket.Chat/pull/22801))
+- User is still asked for 2FA confirmation even if it is deactivated ([#22801](https://github.com/RocketChat/Rocket.Chat/pull/22801) by [@ostjen](https://github.com/ostjen))
- User presence being processes even if presence monitor was disabled ([#22927](https://github.com/RocketChat/Rocket.Chat/pull/22927))
@@ -3633,6 +3715,7 @@
- [@hrahul2605](https://github.com/hrahul2605)
- [@jsm84](https://github.com/jsm84)
- [@nmagedman](https://github.com/nmagedman)
+- [@ostjen](https://github.com/ostjen)
- [@piotrkochan](https://github.com/piotrkochan)
### ๐ฉโ๐ป๐จโ๐ป Core Team ๐ค
@@ -3646,7 +3729,6 @@
- [@marceloschmidt](https://github.com/marceloschmidt)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@sampaiodiego](https://github.com/sampaiodiego)
@@ -3764,14 +3846,14 @@
- Federation setup ([#22208](https://github.com/RocketChat/Rocket.Chat/pull/22208) by [@g-thome](https://github.com/g-thome))
-- Logout other user endpoint ([#22661](https://github.com/RocketChat/Rocket.Chat/pull/22661))
+- Logout other user endpoint ([#22661](https://github.com/RocketChat/Rocket.Chat/pull/22661) by [@ostjen](https://github.com/ostjen))
- Monitoring Track messages' round trip time ([#22676](https://github.com/RocketChat/Rocket.Chat/pull/22676))
Track messages' roundtrip time from backend saves time to the time when received back from the oplog allowing track of oplog slowness.
Prometheus metric: `rocketchat_messages_roundtrip_time`
-- REST endpoint to remove User from Role ([#20485](https://github.com/RocketChat/Rocket.Chat/pull/20485) by [@Cosnavel](https://github.com/Cosnavel) & [@lucassartor](https://github.com/lucassartor))
+- REST endpoint to remove User from Role ([#20485](https://github.com/RocketChat/Rocket.Chat/pull/20485) by [@Cosnavel](https://github.com/Cosnavel) & [@lucassartor](https://github.com/lucassartor) & [@ostjen](https://github.com/ostjen))
### ๐ Improvements
@@ -3892,7 +3974,7 @@
If the commit hash happens to be null, the administration page will still attempt to slice the value and display it. This causes the admin page to not display, and essentially crash the web app. This fixes it by checking for a null value first.
-- Blank screen in message auditing DM tab ([#22763](https://github.com/RocketChat/Rocket.Chat/pull/22763))
+- Blank screen in message auditing DM tab ([#22763](https://github.com/RocketChat/Rocket.Chat/pull/22763) by [@ostjen](https://github.com/ostjen))
The DM tab in message auditing was displaying a blank screen, instead of the actual tab.
@@ -3929,9 +4011,9 @@
**New behavior:**
![image](https://user-images.githubusercontent.com/49413772/124958882-05a8e800-dff1-11eb-8203-b34a4f1c98a0.png)
-- Channel is automatically getting added to the first option in move to team feature ([#22670](https://github.com/RocketChat/Rocket.Chat/pull/22670))
+- Channel is automatically getting added to the first option in move to team feature ([#22670](https://github.com/RocketChat/Rocket.Chat/pull/22670) by [@ostjen](https://github.com/ostjen))
-- Channels or Teams deleted are not removed from the sidebar. ([#22613](https://github.com/RocketChat/Rocket.Chat/pull/22613))
+- Channels or Teams deleted are not removed from the sidebar. ([#22613](https://github.com/RocketChat/Rocket.Chat/pull/22613) by [@ostjen](https://github.com/ostjen))
- Checks the list of agents if at least one is online ([#22584](https://github.com/RocketChat/Rocket.Chat/pull/22584))
@@ -3939,7 +4021,7 @@
- Content-Security-Policy ignoring CDN configuration ([#22791](https://github.com/RocketChat/Rocket.Chat/pull/22791) by [@nmagedman](https://github.com/nmagedman))
-- Create discussion modal - cancel button and invite users alignment ([#22718](https://github.com/RocketChat/Rocket.Chat/pull/22718))
+- Create discussion modal - cancel button and invite users alignment ([#22718](https://github.com/RocketChat/Rocket.Chat/pull/22718) by [@ostjen](https://github.com/ostjen))
Changes in "open discussion" modal
@@ -4042,11 +4124,11 @@
- Chore: [Snyk] Security upgrade node-gcm from 0.14.4 to 1.0.0 ([#22582](https://github.com/RocketChat/Rocket.Chat/pull/22582) by [@snyk-bot](https://github.com/snyk-bot))
-- Chore: added pagination to search msg endpoint ([#22632](https://github.com/RocketChat/Rocket.Chat/pull/22632))
+- Chore: added pagination to search msg endpoint ([#22632](https://github.com/RocketChat/Rocket.Chat/pull/22632) by [@ostjen](https://github.com/ostjen))
- Chore: Create README.md ([#22615](https://github.com/RocketChat/Rocket.Chat/pull/22615))
-- Chore: Enable Omnicahnnel by default ([#22697](https://github.com/RocketChat/Rocket.Chat/pull/22697))
+- Chore: Enable Omnicahnnel by default ([#22697](https://github.com/RocketChat/Rocket.Chat/pull/22697) by [@ostjen](https://github.com/ostjen))
- Chore: Meteor 2.2 and bump dependencies ([#22399](https://github.com/RocketChat/Rocket.Chat/pull/22399))
@@ -4182,6 +4264,7 @@
- [@g-thome](https://github.com/g-thome)
- [@lucassartor](https://github.com/lucassartor)
- [@nmagedman](https://github.com/nmagedman)
+- [@ostjen](https://github.com/ostjen)
- [@rafaelblink](https://github.com/rafaelblink)
- [@snyk-bot](https://github.com/snyk-bot)
@@ -4197,7 +4280,6 @@
- [@ggazzo](https://github.com/ggazzo)
- [@matheusbsilva137](https://github.com/matheusbsilva137)
- [@murtaza98](https://github.com/murtaza98)
-- [@ostjen](https://github.com/ostjen)
- [@pierre-lehnen-rc](https://github.com/pierre-lehnen-rc)
- [@renatobecker](https://github.com/renatobecker)
- [@rodrigok](https://github.com/rodrigok)
diff --git a/app/lib/server/functions/setUserActiveStatus.ts b/app/lib/server/functions/setUserActiveStatus.ts
index 28db6387e432..69fcd6d5bc32 100644
--- a/app/lib/server/functions/setUserActiveStatus.ts
+++ b/app/lib/server/functions/setUserActiveStatus.ts
@@ -62,7 +62,7 @@ export function setUserActiveStatus(userId: string, active: boolean, confirmReli
if (shouldRemoveOrChangeOwner(chatSubscribedRooms) && !confirmRelinquish) {
const rooms = getUserSingleOwnedRooms(chatSubscribedRooms as []);
- throw new Meteor.Error('user-last-owner', '', String(rooms));
+ throw new Meteor.Error('user-last-owner', '', rooms);
}
closeOmnichannelConversations(user, livechatSubscribedRooms);
diff --git a/app/models/server/raw/Analytics.ts b/app/models/server/raw/Analytics.ts
index e78f219d2650..23a2b637d2f9 100644
--- a/app/models/server/raw/Analytics.ts
+++ b/app/models/server/raw/Analytics.ts
@@ -1,14 +1,16 @@
import { Random } from 'meteor/random';
import { AggregationCursor, Cursor, SortOptionObject, UpdateWriteOpResult } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IAnalytic } from '../../../../definition/IAnalytic';
import { IRoom } from '../../../../definition/IRoom';
type T = IAnalytic;
export class AnalyticsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { date: 1 } }, { key: { 'room._id': 1, 'date': 1 }, unique: true }];
+ protected modelIndexes() {
+ return [{ key: { date: 1 } }, { key: { 'room._id': 1, 'date': 1 }, unique: true }];
+ }
saveMessageSent({ room, date }: { room: IRoom; date: IAnalytic['date'] }): Promise {
return this.updateMany(
diff --git a/app/models/server/raw/Avatars.ts b/app/models/server/raw/Avatars.ts
index 33628d6eb66e..f092c34b8e67 100644
--- a/app/models/server/raw/Avatars.ts
+++ b/app/models/server/raw/Avatars.ts
@@ -1,13 +1,15 @@
import { DeleteWriteOpResultObject, UpdateWriteOpResult } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IAvatar as T } from '../../../../definition/IAvatar';
export class AvatarsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [
- { key: { name: 1 }, sparse: true },
- { key: { rid: 1 }, sparse: true },
- ];
+ protected modelIndexes() {
+ return [
+ { key: { name: 1 }, sparse: true },
+ { key: { rid: 1 }, sparse: true },
+ ];
+ }
insertAvatarFileInit(name: string, userId: string, store: string, file: { name: string }, extra: object): Promise {
const fileData = {
diff --git a/app/models/server/raw/Banners.ts b/app/models/server/raw/Banners.ts
index c0285527d78d..6b1db0a94c38 100644
--- a/app/models/server/raw/Banners.ts
+++ b/app/models/server/raw/Banners.ts
@@ -1,16 +1,12 @@
-import { Collection, Cursor, FindOneOptions, UpdateWriteOpResult, WithoutProjection, InsertOneWriteOpResult } from 'mongodb';
+import { Cursor, FindOneOptions, UpdateWriteOpResult, WithoutProjection, InsertOneWriteOpResult } from 'mongodb';
import { BannerPlatform, IBanner } from '../../../../definition/IBanner';
import { BaseRaw } from './BaseRaw';
type T = IBanner;
export class BannersRaw extends BaseRaw {
- constructor(public readonly col: Collection, trash?: Collection) {
- super(col, trash);
-
- this.col.createIndexes([{ key: { platform: 1, startAt: 1, expireAt: 1 } }]);
-
- this.col.createIndexes([{ key: { platform: 1, startAt: 1, expireAt: 1, active: 1 } }]);
+ protected modelIndexes() {
+ return [{ key: { platform: 1, startAt: 1, expireAt: 1 } }, { key: { platform: 1, startAt: 1, expireAt: 1, active: 1 } }];
}
create(doc: IBanner): Promise> {
diff --git a/app/models/server/raw/BannersDismiss.ts b/app/models/server/raw/BannersDismiss.ts
index 61325e5423f3..007a7e155143 100644
--- a/app/models/server/raw/BannersDismiss.ts
+++ b/app/models/server/raw/BannersDismiss.ts
@@ -1,13 +1,11 @@
-import { Collection, Cursor, FindOneOptions, WithoutProjection } from 'mongodb';
+import { Cursor, FindOneOptions, WithoutProjection } from 'mongodb';
import { IBannerDismiss } from '../../../../definition/IBanner';
import { BaseRaw } from './BaseRaw';
export class BannersDismissRaw extends BaseRaw {
- constructor(public readonly col: Collection, trash?: Collection) {
- super(col, trash);
-
- this.col.createIndexes([{ key: { userId: 1, bannerId: 1 } }]);
+ modelIndexes() {
+ return [{ key: { userId: 1, bannerId: 1 } }];
}
findByUserIdAndBannerId(userId: string, bannerIds: string[]): Cursor;
diff --git a/app/models/server/raw/BaseRaw.ts b/app/models/server/raw/BaseRaw.ts
index c4066eea7abc..90c0fcfc63df 100644
--- a/app/models/server/raw/BaseRaw.ts
+++ b/app/models/server/raw/BaseRaw.ts
@@ -73,8 +73,6 @@ const warnFields =
export class BaseRaw = undefined> implements IBaseRaw {
public readonly defaultFields: C;
- protected indexes?: IndexSpecification[];
-
protected name: string;
private preventSetUpdatedAt: boolean;
@@ -85,13 +83,18 @@ export class BaseRaw = undefined> implements IBase
this.name = this.col.collectionName.replace(baseName, '');
this.trash = trash as unknown as Collection>;
- if (this.indexes?.length) {
- this.col.createIndexes(this.indexes);
+ const indexes = this.modelIndexes();
+ if (indexes?.length) {
+ this.col.createIndexes(indexes);
}
this.preventSetUpdatedAt = options?.preventSetUpdatedAt ?? false;
}
+ protected modelIndexes(): IndexSpecification[] | void {
+ // noop
+ }
+
private doNotMixInclusionAndExclusionFields(options: FindOneOptions = {}): FindOneOptions {
const optionsDef = this.ensureDefaultFields(options);
if (optionsDef?.projection === undefined) {
diff --git a/app/models/server/raw/CredentialTokens.ts b/app/models/server/raw/CredentialTokens.ts
index 930d00527165..9288eca4dac1 100644
--- a/app/models/server/raw/CredentialTokens.ts
+++ b/app/models/server/raw/CredentialTokens.ts
@@ -1,8 +1,10 @@
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { ICredentialToken as T } from '../../../../definition/ICredentialToken';
export class CredentialTokensRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { expireAt: 1 }, sparse: true, expireAfterSeconds: 0 }];
+ protected modelIndexes() {
+ return [{ key: { expireAt: 1 }, sparse: true, expireAfterSeconds: 0 }];
+ }
async create(_id: string, userInfo: T['userInfo']): Promise {
const validForMilliseconds = 60000; // Valid for 60 seconds
diff --git a/app/models/server/raw/CustomSounds.ts b/app/models/server/raw/CustomSounds.ts
index 5e7dd4572ac9..9dc83064da1f 100644
--- a/app/models/server/raw/CustomSounds.ts
+++ b/app/models/server/raw/CustomSounds.ts
@@ -1,10 +1,12 @@
import { Cursor, FindOneOptions, InsertOneWriteOpResult, UpdateWriteOpResult, WithId, WithoutProjection } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { ICustomSound as T } from '../../../../definition/ICustomSound';
export class CustomSoundsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { name: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { name: 1 } }];
+ }
// find
findByName(name: string, options: WithoutProjection>): Cursor {
diff --git a/app/models/server/raw/CustomUserStatus.ts b/app/models/server/raw/CustomUserStatus.ts
index d4ed3321183d..8d342d67bbe0 100644
--- a/app/models/server/raw/CustomUserStatus.ts
+++ b/app/models/server/raw/CustomUserStatus.ts
@@ -1,10 +1,12 @@
import { Cursor, FindOneOptions, InsertOneWriteOpResult, UpdateWriteOpResult, WithId, WithoutProjection } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { ICustomUserStatus as T } from '../../../../definition/ICustomUserStatus';
export class CustomUserStatusRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { name: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { name: 1 } }];
+ }
// find one by name
async findOneByName(name: string, options: WithoutProjection>): Promise {
diff --git a/app/models/server/raw/EmailInbox.ts b/app/models/server/raw/EmailInbox.ts
index 38889a1d9072..dacb35b385ac 100644
--- a/app/models/server/raw/EmailInbox.ts
+++ b/app/models/server/raw/EmailInbox.ts
@@ -1,6 +1,8 @@
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IEmailInbox } from '../../../../definition/IEmailInbox';
export class EmailInboxRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { email: 1 }, unique: true }];
+ protected modelIndexes() {
+ return [{ key: { email: 1 }, unique: true }];
+ }
}
diff --git a/app/models/server/raw/EmailMessageHistory.ts b/app/models/server/raw/EmailMessageHistory.ts
index df97023387ea..df1315dc5525 100644
--- a/app/models/server/raw/EmailMessageHistory.ts
+++ b/app/models/server/raw/EmailMessageHistory.ts
@@ -1,10 +1,12 @@
-import { IndexSpecification, InsertOneWriteOpResult, WithId } from 'mongodb';
+import { InsertOneWriteOpResult, WithId } from 'mongodb';
import { BaseRaw } from './BaseRaw';
import { IEmailMessageHistory as T } from '../../../../definition/IEmailMessageHistory';
export class EmailMessageHistoryRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { createdAt: 1 }, expireAfterSeconds: 60 * 60 * 24 }];
+ protected modelIndexes() {
+ return [{ key: { createdAt: 1 }, expireAfterSeconds: 60 * 60 * 24 }];
+ }
async create({ _id, email }: T): Promise>> {
return this.insertOne({
diff --git a/app/models/server/raw/EmojiCustom.ts b/app/models/server/raw/EmojiCustom.ts
index 17d45215a5ed..538be1ae3fef 100644
--- a/app/models/server/raw/EmojiCustom.ts
+++ b/app/models/server/raw/EmojiCustom.ts
@@ -1,10 +1,12 @@
import { Cursor, FindOneOptions, InsertOneWriteOpResult, UpdateWriteOpResult, WithId, WithoutProjection } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IEmojiCustom as T } from '../../../../definition/IEmojiCustom';
export class EmojiCustomRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { name: 1 } }, { key: { aliases: 1 } }, { key: { extension: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { name: 1 } }, { key: { aliases: 1 } }, { key: { extension: 1 } }];
+ }
// find
findByNameOrAlias(emojiName: string, options: WithoutProjection>): Cursor {
diff --git a/app/models/server/raw/ExportOperations.ts b/app/models/server/raw/ExportOperations.ts
index b29f54be4a3b..a1e8e95dd7c2 100644
--- a/app/models/server/raw/ExportOperations.ts
+++ b/app/models/server/raw/ExportOperations.ts
@@ -1,12 +1,14 @@
import { Cursor, UpdateWriteOpResult } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IExportOperation } from '../../../../definition/IExportOperation';
type T = IExportOperation;
export class ExportOperationsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { userId: 1 } }, { key: { status: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { userId: 1 } }, { key: { status: 1 } }];
+ }
findOnePending(): Promise {
const query = {
diff --git a/app/models/server/raw/FederationServers.ts b/app/models/server/raw/FederationServers.ts
index 5118aa8d2fcf..d660784d2441 100644
--- a/app/models/server/raw/FederationServers.ts
+++ b/app/models/server/raw/FederationServers.ts
@@ -2,10 +2,12 @@ import { UpdateWriteOpResult } from 'mongodb';
import { Users } from './index';
import { IFederationServer } from '../../../../definition/Federation';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
export class FederationServersRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { domain: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { domain: 1 } }];
+ }
saveDomain(domain: string): Promise {
return this.updateOne(
diff --git a/app/models/server/raw/IntegrationHistory.ts b/app/models/server/raw/IntegrationHistory.ts
index ef2f2b365c8b..41e763e91a78 100644
--- a/app/models/server/raw/IntegrationHistory.ts
+++ b/app/models/server/raw/IntegrationHistory.ts
@@ -1,8 +1,10 @@
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IIntegrationHistory } from '../../../../definition/IIntegrationHistory';
export class IntegrationHistoryRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { 'integration._id': 1, 'integration._createdBy._id': 1 } }];
+ protected modelIndexes() {
+ return [{ key: { 'integration._id': 1, 'integration._createdBy._id': 1 } }];
+ }
removeByIntegrationId(integrationId: string): ReturnType['deleteMany']> {
return this.deleteMany({ 'integration._id': integrationId });
diff --git a/app/models/server/raw/Integrations.ts b/app/models/server/raw/Integrations.ts
index c1c7de6b07bd..e7b4f1cc8df7 100644
--- a/app/models/server/raw/Integrations.ts
+++ b/app/models/server/raw/Integrations.ts
@@ -1,8 +1,10 @@
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IIntegration } from '../../../../definition/IIntegration';
export class IntegrationsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { type: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { type: 1 } }];
+ }
findOneByUrl(url: string): Promise {
return this.findOne({ url });
diff --git a/app/models/server/raw/LivechatTrigger.ts b/app/models/server/raw/LivechatTrigger.ts
index e8311c5faef0..a582a06778d3 100644
--- a/app/models/server/raw/LivechatTrigger.ts
+++ b/app/models/server/raw/LivechatTrigger.ts
@@ -1,10 +1,12 @@
import { Cursor, UpdateWriteOpResult } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { ILivechatTrigger } from '../../../../definition/ILivechatTrigger';
export class LivechatTriggerRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { enabled: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { enabled: 1 } }];
+ }
findEnabled(): Cursor {
return this.find({ enabled: true });
diff --git a/app/models/server/raw/NotificationQueue.ts b/app/models/server/raw/NotificationQueue.ts
index 23b820ab2393..c98f115e066b 100644
--- a/app/models/server/raw/NotificationQueue.ts
+++ b/app/models/server/raw/NotificationQueue.ts
@@ -1,16 +1,18 @@
import { UpdateWriteOpResult } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { INotification } from '../../../../definition/INotification';
export class NotificationQueueRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [
- { key: { uid: 1 } },
- { key: { ts: 1 }, expireAfterSeconds: 2 * 60 * 60 },
- { key: { schedule: 1 }, sparse: true },
- { key: { sending: 1 }, sparse: true },
- { key: { error: 1 }, sparse: true },
- ];
+ protected modelIndexes() {
+ return [
+ { key: { uid: 1 } },
+ { key: { ts: 1 }, expireAfterSeconds: 2 * 60 * 60 },
+ { key: { schedule: 1 }, sparse: true },
+ { key: { sending: 1 }, sparse: true },
+ { key: { error: 1 }, sparse: true },
+ ];
+ }
unsetSendingById(_id: string): Promise {
return this.updateOne(
diff --git a/app/models/server/raw/Nps.ts b/app/models/server/raw/Nps.ts
index daf123b14d1c..513103057228 100644
--- a/app/models/server/raw/Nps.ts
+++ b/app/models/server/raw/Nps.ts
@@ -1,14 +1,12 @@
-import { UpdateWriteOpResult, Collection } from 'mongodb';
+import { UpdateWriteOpResult } from 'mongodb';
import { BaseRaw } from './BaseRaw';
import { INps, NPSStatus } from '../../../../definition/INps';
type T = INps;
export class NpsRaw extends BaseRaw {
- constructor(public readonly col: Collection, trash?: Collection) {
- super(col, trash);
-
- this.col.createIndexes([{ key: { status: 1, expireAt: 1 } }]);
+ modelIndexes() {
+ return [{ key: { status: 1, expireAt: 1 } }];
}
// get expired surveys still in progress
diff --git a/app/models/server/raw/NpsVote.ts b/app/models/server/raw/NpsVote.ts
index 5aa9c56bda88..19a6842894c0 100644
--- a/app/models/server/raw/NpsVote.ts
+++ b/app/models/server/raw/NpsVote.ts
@@ -1,14 +1,12 @@
-import { ObjectId, Collection, Cursor, FindOneOptions, UpdateWriteOpResult, WithoutProjection } from 'mongodb';
+import { ObjectId, Cursor, FindOneOptions, UpdateWriteOpResult, WithoutProjection } from 'mongodb';
import { INpsVote, INpsVoteStatus } from '../../../../definition/INps';
import { BaseRaw } from './BaseRaw';
type T = INpsVote;
export class NpsVoteRaw extends BaseRaw {
- constructor(public readonly col: Collection, trash?: Collection) {
- super(col, trash);
-
- this.col.createIndexes([{ key: { npsId: 1, status: 1, sentAt: 1 } }, { key: { npsId: 1, identifier: 1 } }]);
+ modelIndexes() {
+ return [{ key: { npsId: 1, status: 1, sentAt: 1 } }, { key: { npsId: 1, identifier: 1 } }];
}
findNotSentByNpsId(npsId: string, options?: WithoutProjection>): Cursor {
diff --git a/app/models/server/raw/OEmbedCache.ts b/app/models/server/raw/OEmbedCache.ts
index e7a4ff2f301d..dc46ab0f2335 100644
--- a/app/models/server/raw/OEmbedCache.ts
+++ b/app/models/server/raw/OEmbedCache.ts
@@ -1,12 +1,14 @@
import { DeleteWriteOpResultObject } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IOEmbedCache } from '../../../../definition/IOEmbedCache';
type T = IOEmbedCache;
export class OEmbedCacheRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { updatedAt: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { updatedAt: 1 } }];
+ }
async createWithIdAndData(_id: string, data: any): Promise {
const record = {
diff --git a/app/models/server/raw/PbxEvents.ts b/app/models/server/raw/PbxEvents.ts
index 19ca711db9ed..56570bc0cf18 100644
--- a/app/models/server/raw/PbxEvents.ts
+++ b/app/models/server/raw/PbxEvents.ts
@@ -1,10 +1,12 @@
import { Cursor } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IPbxEvent } from '../../../../definition/IPbxEvent';
export class PbxEventsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { uniqueId: 1 }, unique: true }];
+ protected modelIndexes() {
+ return [{ key: { uniqueId: 1 }, unique: true }];
+ }
findByEvents(callUniqueId: string, events: string[]): Cursor {
return this.find(
diff --git a/app/models/server/raw/ReadReceipts.ts b/app/models/server/raw/ReadReceipts.ts
index 768cb7c53263..1be190713da5 100644
--- a/app/models/server/raw/ReadReceipts.ts
+++ b/app/models/server/raw/ReadReceipts.ts
@@ -1,10 +1,12 @@
import { Cursor } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { ReadReceipt } from '../../../../definition/ReadReceipt';
export class ReadReceiptsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { roomId: 1, userId: 1, messageId: 1 }, unique: true }, { key: { messageId: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { roomId: 1, userId: 1, messageId: 1 }, unique: true }, { key: { messageId: 1 } }];
+ }
findByMessageId(messageId: string): Cursor {
return this.find({ messageId });
diff --git a/app/models/server/raw/ServerEvents.ts b/app/models/server/raw/ServerEvents.ts
index e40a5e0d5627..ef9731eb86b6 100644
--- a/app/models/server/raw/ServerEvents.ts
+++ b/app/models/server/raw/ServerEvents.ts
@@ -1,8 +1,10 @@
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IServerEvent, IServerEventType } from '../../../../definition/IServerEvent';
export class ServerEventsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { t: 1, ip: 1, ts: -1 } }, { key: { 't': 1, 'u.username': 1, 'ts': -1 } }];
+ protected modelIndexes() {
+ return [{ key: { t: 1, ip: 1, ts: -1 } }, { key: { 't': 1, 'u.username': 1, 'ts': -1 } }];
+ }
async findLastFailedAttemptByIp(ip: string): Promise {
return this.findOne(
diff --git a/app/models/server/raw/Sessions.ts b/app/models/server/raw/Sessions.ts
index 3b7be065d635..726e9407d3f7 100644
--- a/app/models/server/raw/Sessions.ts
+++ b/app/models/server/raw/Sessions.ts
@@ -3,7 +3,6 @@ import {
BulkWriteOperation,
BulkWriteOpResultObject,
Collection,
- IndexSpecification,
UpdateWriteOpResult,
FilterQuery,
Cursor,
@@ -738,18 +737,6 @@ export const aggregates = {
};
export class SessionsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [
- { key: { instanceId: 1, sessionId: 1, year: 1, month: 1, day: 1 } },
- { key: { instanceId: 1, sessionId: 1, userId: 1 } },
- { key: { instanceId: 1, sessionId: 1 } },
- { key: { sessionId: 1 } },
- { key: { userId: 1 } },
- { key: { year: 1, month: 1, day: 1, type: 1 } },
- { key: { type: 1 } },
- { key: { ip: 1, loginAt: 1 } },
- { key: { _computedAt: 1 }, expireAfterSeconds: 60 * 60 * 24 * 45 },
- ];
-
private secondaryCollection: Collection;
constructor(public readonly col: Collection, public readonly colSecondary: Collection, trash?: Collection) {
@@ -758,6 +745,20 @@ export class SessionsRaw extends BaseRaw {
this.secondaryCollection = colSecondary;
}
+ protected modelIndexes() {
+ return [
+ { key: { instanceId: 1, sessionId: 1, year: 1, month: 1, day: 1 } },
+ { key: { instanceId: 1, sessionId: 1, userId: 1 } },
+ { key: { instanceId: 1, sessionId: 1 } },
+ { key: { sessionId: 1 } },
+ { key: { userId: 1 } },
+ { key: { year: 1, month: 1, day: 1, type: 1 } },
+ { key: { type: 1 } },
+ { key: { ip: 1, loginAt: 1 } },
+ { key: { _computedAt: 1 }, expireAfterSeconds: 60 * 60 * 24 * 45 },
+ ];
+ }
+
async getActiveUsersBetweenDates({ start, end }: DestructuredRange): Promise {
return this.col
.aggregate([
diff --git a/app/models/server/raw/Statistics.ts b/app/models/server/raw/Statistics.ts
index 424cb3175efc..d332a7b652f2 100644
--- a/app/models/server/raw/Statistics.ts
+++ b/app/models/server/raw/Statistics.ts
@@ -1,8 +1,10 @@
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IStatistic } from '../../../../definition/IStatistic';
export class StatisticsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { createdAt: -1 } }];
+ protected modelIndexes() {
+ return [{ key: { createdAt: -1 } }];
+ }
async findLast(): Promise {
const options = {
diff --git a/app/models/server/raw/Team.ts b/app/models/server/raw/Team.ts
index 15beb82c9f9d..d4037ac8001c 100644
--- a/app/models/server/raw/Team.ts
+++ b/app/models/server/raw/Team.ts
@@ -1,25 +1,11 @@
-import {
- Collection,
- WithoutProjection,
- FindOneOptions,
- Cursor,
- UpdateWriteOpResult,
- DeleteWriteOpResultObject,
- FilterQuery,
-} from 'mongodb';
+import { WithoutProjection, FindOneOptions, Cursor, UpdateWriteOpResult, DeleteWriteOpResultObject, FilterQuery } from 'mongodb';
import { BaseRaw } from './BaseRaw';
import { ITeam, TEAM_TYPE } from '../../../../definition/ITeam';
export class TeamRaw extends BaseRaw {
- constructor(public readonly col: Collection, trash?: Collection) {
- super(col, trash);
-
- this.col.createIndex({ name: 1 }, { unique: true });
-
- // this.col.createIndexes([
- // { key: { status: 1, expireAt: 1 } },
- // ]);
+ protected modelIndexes() {
+ return [{ key: { name: 1 }, unique: true }];
}
findByNames(names: Array): Cursor;
diff --git a/app/models/server/raw/TeamMember.ts b/app/models/server/raw/TeamMember.ts
index 16a5c1a76baa..d6d4b07a8afc 100644
--- a/app/models/server/raw/TeamMember.ts
+++ b/app/models/server/raw/TeamMember.ts
@@ -1,5 +1,4 @@
import {
- Collection,
WithoutProjection,
FindOneOptions,
Cursor,
@@ -15,13 +14,16 @@ import type { IUser, IRole } from '../../../../definition/IUser';
type T = ITeamMember;
export class TeamMemberRaw extends BaseRaw {
- constructor(public readonly col: Collection, trash?: Collection) {
- super(col, trash);
-
- this.col.createIndexes([{ key: { teamId: 1 } }]);
-
- // teamId => userId should be unique
- this.col.createIndex({ teamId: 1, userId: 1 }, { unique: true });
+ protected modelIndexes() {
+ return [
+ {
+ key: { teamId: 1 },
+ },
+ {
+ key: { teamId: 1, userId: 1 },
+ unique: true,
+ },
+ ];
}
findByUserId(userId: string): Cursor;
diff --git a/app/models/server/raw/Uploads.ts b/app/models/server/raw/Uploads.ts
index 4bd0572bddd8..c8b9c0f23860 100644
--- a/app/models/server/raw/Uploads.ts
+++ b/app/models/server/raw/Uploads.ts
@@ -13,7 +13,7 @@ import {
WriteOpResult,
} from 'mongodb';
-import { BaseRaw, IndexSpecification, InsertionModel } from './BaseRaw';
+import { BaseRaw, InsertionModel } from './BaseRaw';
import { IUpload as T } from '../../../../definition/IUpload';
const fillTypeGroup = (fileData: Partial): void => {
@@ -25,7 +25,9 @@ const fillTypeGroup = (fileData: Partial): void => {
};
export class UploadsRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { rid: 1 } }, { key: { uploadedAt: 1 } }, { key: { typeGroup: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { rid: 1 } }, { key: { uploadedAt: 1 } }, { key: { typeGroup: 1 } }];
+ }
findNotHiddenFilesOfRoom(roomId: string, searchText: string, fileType: string, limit: number): Cursor {
const fileQuery = {
diff --git a/app/models/server/raw/UserDataFiles.ts b/app/models/server/raw/UserDataFiles.ts
index 948456d6f77c..b29cc7d704ee 100644
--- a/app/models/server/raw/UserDataFiles.ts
+++ b/app/models/server/raw/UserDataFiles.ts
@@ -1,10 +1,12 @@
import { FindOneOptions, InsertOneWriteOpResult, WithId, WithoutProjection } from 'mongodb';
-import { BaseRaw, IndexSpecification } from './BaseRaw';
+import { BaseRaw } from './BaseRaw';
import { IUserDataFile as T } from '../../../../definition/IUserDataFile';
export class UserDataFilesRaw extends BaseRaw {
- protected indexes: IndexSpecification[] = [{ key: { userId: 1 } }];
+ protected modelIndexes() {
+ return [{ key: { userId: 1 } }];
+ }
findLastFileByUser(userId: string, options: WithoutProjection> = {}): Promise {
const query = {
diff --git a/app/models/server/raw/WebdavAccounts.ts b/app/models/server/raw/WebdavAccounts.ts
index 9c3d0a8b0fdd..9bda5ee83e93 100644
--- a/app/models/server/raw/WebdavAccounts.ts
+++ b/app/models/server/raw/WebdavAccounts.ts
@@ -1,7 +1,7 @@
/**
* Webdav Accounts model
*/
-import type { Collection, FindOneOptions, Cursor, DeleteWriteOpResultObject } from 'mongodb';
+import type { FindOneOptions, Cursor, DeleteWriteOpResultObject } from 'mongodb';
import { BaseRaw } from './BaseRaw';
import { IWebdavAccount } from '../../../../definition/IWebdavAccount';
@@ -9,10 +9,8 @@ import { IWebdavAccount } from '../../../../definition/IWebdavAccount';
type T = IWebdavAccount;
export class WebdavAccountsRaw extends BaseRaw {
- constructor(public readonly col: Collection, trash?: Collection) {
- super(col, trash);
-
- this.col.createIndex({ userId: 1 });
+ protected modelIndexes() {
+ return [{ key: { userId: 1 } }];
}
findOneByIdAndUserId(_id: string, userId: string, options: FindOneOptions): Promise {
diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info
index 8e55a1fd282d..b63a7bf00f29 100644
--- a/app/utils/rocketchat.info
+++ b/app/utils/rocketchat.info
@@ -1,3 +1,3 @@
{
- "version": "4.6.1"
+ "version": "4.6.2"
}
diff --git a/package-lock.json b/package-lock.json
index b946750a7565..84ff9020a09f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "Rocket.Chat",
- "version": "4.6.1",
+ "version": "4.6.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index ffb543407c25..4ca1d5407f72 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "Rocket.Chat",
"description": "The Ultimate Open Source WebChat Platform",
- "version": "4.6.1",
+ "version": "4.6.2",
"author": {
"name": "Rocket.Chat",
"url": "https://rocket.chat/"