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

Release 4.6.1 #25095

Merged
merged 7 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docker/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/ubi8/nodejs-12

ENV RC_VERSION 4.6.0
ENV RC_VERSION 4.6.1

MAINTAINER buildmaster@rocket.chat

Expand Down
72 changes: 72 additions & 0 deletions .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -73062,6 +73062,78 @@
"5.0"
],
"pull_requests": []
},
"4.6.1": {
"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": "25082",
"title": "[FIX] Invitation links don't redirect to the registration form",
"userLogin": "yash-rajpal",
"milestone": "4.6.1",
"contributors": [
"yash-rajpal"
]
},
{
"pr": "25069",
"title": "[FIX] FormData uploads not working",
"userLogin": "gabriellsh",
"milestone": "4.6.1",
"contributors": [
"gabriellsh",
"dougfabris"
]
},
{
"pr": "25067",
"title": "[FIX] NPS never finishing sending results",
"userLogin": "sampaiodiego",
"milestone": "4.6.1",
"contributors": [
"sampaiodiego"
]
},
{
"pr": "25050",
"title": "[FIX] Upgrade Tab showing for a split second",
"userLogin": "gabriellsh",
"milestone": "4.6.1",
"contributors": [
"gabriellsh"
]
},
{
"pr": "25055",
"title": "[FIX] UserAutoComplete not rendering UserAvatar correctly",
"userLogin": "dougfabris",
"description": "### before\r\n![Screen Shot 2022-04-04 at 16 50 21](https://user-images.githubusercontent.com/27704687/161620921-800bf66a-806d-4f83-b2e1-073c34215001.png)\r\n\r\n### after\r\n![Screen Shot 2022-04-04 at 16 49 00](https://user-images.githubusercontent.com/27704687/161620720-3e27774d-c241-46ca-b764-932a9295d709.png)",
"milestone": "4.6.1",
"contributors": [
"dougfabris"
]
}
]
}
}
}
1 change: 1 addition & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,4 @@ rocketchat:i18n
rocketchat:postcss
dandv:caret-position
facts-base@1.0.1
url
2 changes: 1 addition & 1 deletion .snapcraft/resources/prepareRocketChat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

curl -SLf "https://releases.rocket.chat/4.6.0/download/" -o rocket.chat.tgz
curl -SLf "https://releases.rocket.chat/4.6.1/download/" -o rocket.chat.tgz

tar xf rocket.chat.tgz --strip 1

Expand Down
2 changes: 1 addition & 1 deletion .snapcraft/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 5. `snapcraft snap`

name: rocketchat-server
version: 4.6.0
version: 4.6.1
summary: Rocket.Chat server
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
confinement: strict
Expand Down
1,329 changes: 674 additions & 655 deletions HISTORY.md

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions app/apps/server/bridges/http.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { fetch } from 'meteor/fetch';
import { HttpBridge } from '@rocket.chat/apps-engine/server/bridges/HttpBridge';
import { IHttpResponse } from '@rocket.chat/apps-engine/definition/accessors';
import { IHttpBridgeRequestInfo } from '@rocket.chat/apps-engine/server/bridges';

import { AppServerOrchestrator } from '../orchestrator';
import { getUnsafeAgent } from '../../../../server/lib/getUnsafeAgent';
import { fetch } from '../../../../server/lib/http/fetch';

const isGetOrHead = (method: string): boolean => ['GET', 'HEAD'].includes(method.toUpperCase());

Expand Down Expand Up @@ -70,15 +69,16 @@ export class AppHttpBridge extends HttpBridge {
this.orch.debugLog(`The App ${info.appId} is requesting from the outter webs:`, info);

try {
const response = await fetch(url.href, {
method,
body: content,
headers,
...(((request.hasOwnProperty('strictSSL') && !request.strictSSL) ||
(request.hasOwnProperty('rejectUnauthorized') && request.rejectUnauthorized)) && {
agent: getUnsafeAgent(url.protocol === 'https:' ? 'https:' : 'http:'),
}),
});
const response = await fetch(
url.href,
{
method,
body: content,
headers,
},
(request.hasOwnProperty('strictSSL') && !request.strictSSL) ||
(request.hasOwnProperty('rejectUnauthorized') && request.rejectUnauthorized),
);

const result: IHttpResponse = {
url: info.url,
Expand Down
2 changes: 1 addition & 1 deletion app/apps/server/communication/rest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Meteor } from 'meteor/meteor';
import { HTTP } from 'meteor/http';
import { fetch } from 'meteor/fetch';

import { API } from '../../../api/server';
import { getUploadFormData } from '../../../api/server/lib/getUploadFormData';
Expand All @@ -12,6 +11,7 @@ import { Settings } from '../../../models/server/raw';
import { Apps } from '../orchestrator';
import { formatAppInstanceForRest } from '../../lib/misc/formatAppInstanceForRest';
import { actionButtonsHandler } from './endpoints/actionButtonsHandler';
import { fetch } from '../../../../server/lib/http/fetch';

const appsEngineVersionForMarketplace = Info.marketplaceApiVersion.replace(/-.*/g, '');
const getDefaultHeaders = () => ({
Expand Down
20 changes: 10 additions & 10 deletions app/integrations/server/lib/triggerHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import vm from 'vm';

import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { fetch } from 'meteor/fetch';
import { HTTP } from 'meteor/http';
import _ from 'underscore';
import s from 'underscore.string';
Expand All @@ -16,7 +15,7 @@ import { settings } from '../../../settings/server';
import { getRoomByNameOrIdWithOptionToJoin, processWebhookMessage } from '../../../lib/server';
import { outgoingLogger } from '../logger';
import { integrations } from '../../lib/rocketchat';
import { getUnsafeAgent } from '../../../../server/lib/getUnsafeAgent';
import { fetch } from '../../../../server/lib/http/fetch';

export class RocketChatIntegrationHandler {
constructor() {
Expand Down Expand Up @@ -771,14 +770,15 @@ export class RocketChatIntegrationHandler {
opts.headers['Content-Type'] = 'application/json';
}

fetch(opts.url, {
method: opts.method,
headers: opts.headers,
...(settings.get('Allow_Invalid_SelfSigned_Certs') && {
agent: getUnsafeAgent(opts.url.startsWith('https:') ? 'https:' : 'http:'),
}),
...(opts.data && { body: JSON.stringify(opts.data) }),
})
fetch(
opts.url,
{
method: opts.method,
headers: opts.headers,
...(opts.data && { body: JSON.stringify(opts.data) }),
},
settings.get('Allow_Invalid_SelfSigned_Certs'),
)
.then(async (res) => {
const content = await res.text();
if (!content) {
Expand Down
4 changes: 2 additions & 2 deletions app/lib/server/functions/getAvatarSuggestionForUser.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { check } from 'meteor/check';
import { fetch } from 'meteor/fetch';
import { Gravatar } from 'meteor/jparker:gravatar';
import { ServiceConfiguration } from 'meteor/service-configuration';

import { settings } from '../../../settings';
import { settings } from '../../../settings/server';
import { fetch } from '../../../../server/lib/http/fetch';

const avatarProviders = {
facebook(user) {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/server/functions/setUserAvatar.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Meteor } from 'meteor/meteor';
import { fetch } from 'meteor/fetch';

import { RocketChatFile } from '../../../file/server';
import { FileUpload } from '../../../file-upload/server';
import { Users } from '../../../models/server';
import { SystemLogger } from '../../../../server/lib/logger/system';
import { api } from '../../../../server/sdk/api';
import { fetch } from '../../../../server/lib/http/fetch';
import { IUser } from '../../../../definition/IUser';

export const setUserAvatar = function (
Expand Down
2 changes: 1 addition & 1 deletion app/livechat/imports/server/rest/sms.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { fetch } from 'meteor/fetch';
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';

import { FileUpload } from '../../../../file-upload/server';
import { LivechatRooms, LivechatVisitors, LivechatDepartment } from '../../../../models/server';
import { API } from '../../../../api/server';
import { fetch } from '../../../../../server/lib/http/fetch';
import { SMS } from '../../../../sms';
import { Livechat } from '../../../server/lib/Livechat';
import { OmnichannelSourceType } from '../../../../../definition/IRoom';
Expand Down
4 changes: 3 additions & 1 deletion app/models/server/raw/IntegrationHistory.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { BaseRaw } from './BaseRaw';
import { BaseRaw, IndexSpecification } from './BaseRaw';
import { IIntegrationHistory } from '../../../../definition/IIntegrationHistory';

export class IntegrationHistoryRaw extends BaseRaw<IIntegrationHistory> {
protected indexes: IndexSpecification[] = [{ key: { 'integration._id': 1, 'integration._createdBy._id': 1 } }];

removeByIntegrationId(integrationId: string): ReturnType<BaseRaw<IIntegrationHistory>['deleteMany']> {
return this.deleteMany({ 'integration._id': integrationId });
}
Expand Down
26 changes: 13 additions & 13 deletions app/oembed/server/server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import URL from 'url';
import querystring from 'querystring';

import { fetch } from 'meteor/fetch';
import { camelCase } from 'change-case';
import _ from 'underscore';
import iconv from 'iconv-lite';
Expand All @@ -16,7 +15,7 @@ import { settings } from '../../settings/server';
import { isURL } from '../../utils/lib/isURL';
import { SystemLogger } from '../../../server/lib/logger/system';
import { Info } from '../../utils/server';
import { getUnsafeAgent } from '../../../server/lib/getUnsafeAgent';
import { fetch } from '../../../server/lib/http/fetch';

const OEmbed = {};

Expand Down Expand Up @@ -101,18 +100,19 @@ const getUrlContent = async function (urlObj, redirectCount = 5) {

const sizeLimit = 250000;

const response = await fetch(url, {
compress: true,
follow: redirectCount,
headers: {
'User-Agent': `${settings.get('API_Embed_UserAgent')} Rocket.Chat/${Info.version}`,
'Accept-Language': settings.get('Language') || 'en',
const response = await fetch(
url,
{
compress: true,
follow: redirectCount,
headers: {
'User-Agent': `${settings.get('API_Embed_UserAgent')} Rocket.Chat/${Info.version}`,
'Accept-Language': settings.get('Language') || 'en',
},
size: sizeLimit, // max size of the response body, this was not working as expected so I'm also manually verifying that on the iterator
},
size: sizeLimit, // max size of the response body, this was not working as expected so I'm also manually verifying that on the iterator
...(settings.get('Allow_Invalid_SelfSigned_Certs') && {
agent: getUnsafeAgent(parsedUrl.protocol),
}),
});
settings.get('Allow_Invalid_SelfSigned_Certs'),
);

let totalSize = 0;
const chunks = [];
Expand Down
2 changes: 1 addition & 1 deletion app/utils/rocketchat.info
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "4.6.0"
"version": "4.6.1"
}
6 changes: 4 additions & 2 deletions client/components/UserAutoComplete/UserAutoComplete.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AutoComplete, Option, Box, Chip, Avatar } from '@rocket.chat/fuselage';
import { AutoComplete, Option, Box, Chip, Options } from '@rocket.chat/fuselage';
import { useDebouncedValue } from '@rocket.chat/fuselage-hooks';
import React, { memo, useMemo, useState } from 'react';

Expand Down Expand Up @@ -38,7 +38,9 @@ const UserAutoComplete = (props) => {
</Chip>
);
}}
renderItem={({ value, ...props }) => <Option key={value} {...props} avatar={<Avatar value={value} />} />}
renderItem={({ value, ...props }) => (
<Option key={value} avatar={<UserAvatar size={Options.AvatarSize} username={value} />} {...props} />
)}
options={options}
/>
);
Expand Down
6 changes: 3 additions & 3 deletions client/hooks/useEndpointUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export const useEndpointUpload = (
endpoint: string,
params = {},
successMessage: string,
): ((...args: any[]) => Promise<{ success: boolean }>) => {
): ((formData: FormData) => Promise<{ success: boolean }>) => {
const sendData = useUpload(endpoint);
const dispatchToastMessage = useToastMessageDispatch();

return useCallback(
async (...args) => {
async (formData: FormData) => {
try {
const data = sendData(params, [...args]);
const data = sendData(params, formData);

const promise = data instanceof Promise ? data : data.promise;

Expand Down
4 changes: 2 additions & 2 deletions client/views/admin/sidebar/AdminSidebarPages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ type AdminSidebarPagesProps = {

const AdminSidebarPages: FC<AdminSidebarPagesProps> = ({ currentPath }) => {
const items = useSubscription(itemsSubscription);
const { tabType, trialEndDate } = useUpgradeTabParams();
const { tabType, trialEndDate, isLoading } = useUpgradeTabParams();

return (
<Box display='flex' flexDirection='column' flexShrink={0} pb='x8'>
{tabType && <UpgradeTab type={tabType} currentPath={currentPath} trialEndDate={trialEndDate} />}
{!isLoading && tabType && <UpgradeTab type={tabType} currentPath={currentPath} trialEndDate={trialEndDate} />}
<Sidebar.ItemsAssembler items={items} currentPath={currentPath} />
</Box>
);
Expand Down
7 changes: 6 additions & 1 deletion client/views/invite/InvitePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useSetting } from '../../contexts/SettingsContext';
import { useToastMessageDispatch } from '../../contexts/ToastMessagesContext';
import { useTranslation } from '../../contexts/TranslationContext';
import { useUserId } from '../../contexts/UserContext';
import LoginPage from '../root/MainLayout/LoginPage';
import PageLoading from '../root/PageLoading';

const InvitePage = (): ReactElement => {
Expand All @@ -23,7 +24,7 @@ const InvitePage = (): ReactElement => {
const groupRoute = useRoute('/group/:name/:tab?/:context?');
const channelRoute = useRoute('/channel/:name/:tab?/:context?');

const { isLoading } = useQuery(
const { isLoading, data } = useQuery(
['invite', token],
async () => {
if (!token) {
Expand Down Expand Up @@ -85,6 +86,10 @@ const InvitePage = (): ReactElement => {
},
);

if (data) {
return <LoginPage />;
}

if (isLoading) {
return <PageLoading />;
}
Expand Down
6 changes: 6 additions & 0 deletions definition/externals/meteor/url.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module 'meteor/url' {
export const URL: typeof window.URL & {
_constructUrl(url: string, query?: string, paramsForUrl?: Record<string, string>): string;
};
export const URLSearchParams: typeof window.URLSearchParams;
}
Loading