Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/remove-methods-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored Feb 13, 2025
2 parents 980e3b6 + baa49f0 commit 66767bc
Show file tree
Hide file tree
Showing 155 changed files with 3,009 additions and 1,703 deletions.
6 changes: 6 additions & 0 deletions .changeset/brave-ties-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/i18n': patch
'@rocket.chat/meteor': patch
---

fixes toast with empty error messages when a private app installation fails
5 changes: 5 additions & 0 deletions .changeset/kind-geckos-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixes incorrect start date on omnichannel reports
5 changes: 5 additions & 0 deletions .changeset/olive-stingrays-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/cas-validate": patch
---

Fixes a problem with CAS when URL connection ended with `/`
5 changes: 5 additions & 0 deletions .changeset/proud-mayflies-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': minor
---

Includes attachments metadata in JSON export if type is file when exporting messages
5 changes: 5 additions & 0 deletions .changeset/seven-otters-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes an issue where custom status' values in the custom status page table were not being properly translated
5 changes: 5 additions & 0 deletions .changeset/thick-boats-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes an issue where assign extension button were missing the proper margin
8 changes: 8 additions & 0 deletions .changeset/yellow-cars-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@rocket.chat/fuselage-ui-kit': patch
'@rocket.chat/ui-video-conf': patch
'@rocket.chat/i18n': patch
'@rocket.chat/meteor': patch
---

Fixes an issue where video conf message block wasn't considering display avatars preference
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/apps/meteor/app/voip @RocketChat/omnichannel
/apps/meteor/app/sms @RocketChat/omnichannel
/apps/meteor/server @RocketChat/backend
/apps/meteor/server/models @RocketChat/Architecture
/packages/models @RocketChat/Architecture
apps/meteor/server/startup/migrations @RocketChat/Architecture
/apps/meteor/packages/rocketchat-livechat @RocketChat/omnichannel
/apps/meteor/server/services/voip-asterisk @RocketChat/omnichannel
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ runs:
if: inputs.setup == 'true'
shell: bash
- if: ${{ inputs.platform == 'alpine' }}
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/build/matrix-sdk-crypto.linux-x64-musl.node
key: matrix-rust-sdk-crypto-nodejs-v0.2.0-beta.1
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Free for 30 days. Afterward, choose between continuing to host on our secure clo

[Start your cloud hosted trial now](https://rocket.chat/trial-saas)

# 📖 Docs for Developers, Admins and Users
Please make sure to visit our [Docs](https://docs.rocket.chat/) and [Developer Docs](https://developer.rocket.chat/docs) before sending questions.

# 🛠️ Local development

## Prerequisites
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/api/server/v1/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ API.v1.addRoute(
authRequired: false,
rateLimiterOptions: {
numRequestsAllowed: settings.get('Rate_Limiter_Limit_RegisterUser') ?? 1,
intervalTimeInMS: settings.get('API_Enable_Rate_Limiter_Limit_Time_Default') ?? 600000,
intervalTimeInMS: settings.get('API_Enable_Rate_Limiter_Limit_Time_Default') ?? 60000,
},
validateParams: isUserRegisterParamsPOST,
},
Expand Down
2 changes: 0 additions & 2 deletions apps/meteor/app/assets/server/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,6 @@ void (async () => {
}
})();

settings.watchByRegex(/^Assets_/, (key, value) => RocketChatAssets.processAsset(key, value));

Meteor.startup(() => {
setTimeout(() => {
process.emit('message', {
Expand Down
24 changes: 13 additions & 11 deletions apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Cloud, Serialized } from '@rocket.chat/core-typings';
import { Settings } from '@rocket.chat/models';
import { serverFetch as fetch } from '@rocket.chat/server-fetch';
import { v, compile } from 'suretype';
import { z } from 'zod';

import { callbacks } from '../../../../lib/callbacks';
import { CloudWorkspaceConnectionError } from '../../../../lib/errors/CloudWorkspaceConnectionError';
Expand All @@ -11,17 +11,14 @@ import { settings } from '../../../settings/server';
import { LICENSE_VERSION } from '../license';
import { getWorkspaceAccessToken } from './getWorkspaceAccessToken';

const workspaceLicensePayloadSchema = v.object({
version: v.number().required(),
address: v.string().required(),
license: v.string().required(),
updatedAt: v.string().format('date-time').required(),
modules: v.string().required(),
expireAt: v.string().format('date-time').required(),
const workspaceLicensePayloadSchema = z.object({
version: z.number(),
address: z.string(),
license: z.string(),
updatedAt: z.string().datetime(),
expireAt: z.string().datetime(),
});

const assertWorkspaceLicensePayload = compile(workspaceLicensePayloadSchema);

const fetchCloudWorkspaceLicensePayload = async ({ token }: { token: string }): Promise<Serialized<Cloud.WorkspaceLicensePayload>> => {
const workspaceRegistrationClientUri = settings.get<string>('Cloud_Workspace_Registration_Client_Uri');
const response = await fetch(`${workspaceRegistrationClientUri}/license`, {
Expand All @@ -44,14 +41,19 @@ const fetchCloudWorkspaceLicensePayload = async ({ token }: { token: string }):

const payload = await response.json();

assertWorkspaceLicensePayload(payload);
const assertWorkspaceLicensePayload = workspaceLicensePayloadSchema.safeParse(payload);

if (!assertWorkspaceLicensePayload.success) {
SystemLogger.error({ msg: 'workspaceLicensePayloadSchema failed type validation', errors: assertWorkspaceLicensePayload.error.errors });
}

return payload;
};

export async function getWorkspaceLicense() {
const currentLicense = await Settings.findOne('Cloud_Workspace_License');
// it should never happen, since even if the license is not found, it will return an empty settings

if (!currentLicense?._updatedAt) {
throw new CloudWorkspaceLicenseError('Failed to retrieve current license');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Cloud, type Serialized } from '@rocket.chat/core-typings';
import { serverFetch as fetch } from '@rocket.chat/server-fetch';
import { v, compile } from 'suretype';
import { z } from 'zod';

import { CloudWorkspaceConnectionError } from '../../../../../lib/errors/CloudWorkspaceConnectionError';
import { CloudWorkspaceRegistrationError } from '../../../../../lib/errors/CloudWorkspaceRegistrationError';
Expand All @@ -11,38 +11,38 @@ import { CloudWorkspaceAccessTokenEmptyError, getWorkspaceAccessToken } from '..
import { retrieveRegistrationStatus } from '../retrieveRegistrationStatus';
import { handleAnnouncementsOnWorkspaceSync, handleNpsOnWorkspaceSync } from './handleCommsSync';

const workspaceCommPayloadSchema = v.object({
workspaceId: v.string().required(),
publicKey: v.string(),
nps: v.object({
id: v.string().required(),
startAt: v.string().format('date-time').required(),
expireAt: v.string().format('date-time').required(),
}),
announcements: v.object({
create: v.array(
v.object({
_id: v.string().required(),
_updatedAt: v.string().format('date-time').required(),
selector: v.object({
roles: v.array(v.string()),
const workspaceCommPayloadSchema = z.object({
workspaceId: z.string().optional(),
publicKey: z.string().optional(),
nps: z
.object({
id: z.string(),
startAt: z.string().datetime(),
expireAt: z.string().datetime(),
})
.optional(),
announcements: z.object({
create: z.array(
z.object({
_id: z.string(),
_updatedAt: z.string().datetime().optional(),
selector: z.object({
roles: z.array(z.string()),
}),
platform: v.array(v.string().enum('web', 'mobile')).required(),
expireAt: v.string().format('date-time').required(),
startAt: v.string().format('date-time').required(),
createdBy: v.string().enum('cloud', 'system').required(),
createdAt: v.string().format('date-time').required(),
dictionary: v.object({}).additional(v.object({}).additional(v.string())),
view: v.any(),
surface: v.string().enum('banner', 'modal').required(),
platform: z.array(z.enum(['web', 'mobile'])),
expireAt: z.string().datetime(),
startAt: z.string().datetime(),
createdBy: z.enum(['cloud', 'system']),
createdAt: z.string().datetime(),
dictionary: z.record(z.record(z.string())).optional(),
view: z.unknown(),
surface: z.enum(['banner', 'modal']),
}),
),
delete: v.array(v.string()),
delete: z.array(z.string()).optional(),
}),
});

const assertWorkspaceCommPayload = compile(workspaceCommPayloadSchema);

const fetchCloudAnnouncementsSync = async ({
token,
data,
Expand Down Expand Up @@ -70,7 +70,12 @@ const fetchCloudAnnouncementsSync = async ({

const payload = await response.json();

assertWorkspaceCommPayload(payload);
const assertWorkspaceCommPayload = workspaceCommPayloadSchema.safeParse(payload);

if (!assertWorkspaceCommPayload.success) {
SystemLogger.error({ msg: 'workspaceCommPayloadSchema failed type validation', errors: assertWorkspaceCommPayload.error.errors });
}

return payload;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import type { Cloud, Serialized } from '@rocket.chat/core-typings';
import { serverFetch as fetch } from '@rocket.chat/server-fetch';
import { v, compile } from 'suretype';
import { z } from 'zod';

import { CloudWorkspaceConnectionError } from '../../../../../lib/errors/CloudWorkspaceConnectionError';
import { SystemLogger } from '../../../../../server/lib/logger/system';
import { settings } from '../../../../settings/server';

const workspaceSyncPayloadSchema = v.object({
workspaceId: v.string().required(),
publicKey: v.string(),
license: v.string().required(),
const workspaceSyncPayloadSchema = z.object({
workspaceId: z.string(),
publicKey: z.string().optional(),
license: z.string(),
});

const assertWorkspaceSyncPayload = compile(workspaceSyncPayloadSchema);

export async function fetchWorkspaceSyncPayload({
token,
data,
Expand All @@ -36,7 +35,11 @@ export async function fetchWorkspaceSyncPayload({

const payload = await response.json();

assertWorkspaceSyncPayload(payload);
const assertWorkspaceSyncPayload = workspaceSyncPayloadSchema.safeParse(payload);

if (!assertWorkspaceSyncPayload.success) {
SystemLogger.error({ msg: 'workspaceCommPayloadSchema failed type validation', errors: assertWorkspaceSyncPayload.error.errors });
}

return payload;
}
Loading

0 comments on commit 66767bc

Please sign in to comment.