Fix the update check not working (#17809)

Co-authored-by: Aaron Ogle <geekgonecrazy@users.noreply.github.com>
pull/17746/head
Bradley Hilton 5 years ago committed by GitHub
parent 62a7ffc242
commit bcf26aaf89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/version-check/server/functions/checkVersionUpdate.js
  2. 12
      app/version-check/server/functions/getNewUpdates.js

@ -44,7 +44,7 @@ export default () => {
sendMessagesToAdmins({
msgs: ({ adminUser }) => [{ msg: `*${ TAPi18n.__('Update_your_RocketChat', adminUser.language) }*\n${ TAPi18n.__('New_version_available_(s)', update.lastestVersion.version, adminUser.language) }\n${ update.lastestVersion.infoUrl }` }],
banners: [{
id: 'versionUpdate',
id: `versionUpdate-${ update.lastestVersion.version }`.replace(/\./g, '_'),
priority: 10,
title: 'Update_your_RocketChat',
text: 'New_version_available_(s)',
@ -62,7 +62,7 @@ export default () => {
msg: `*${ TAPi18n.__('Rocket_Chat_Alert', adminUser.language) }:*\n\n*${ TAPi18n.__(alert.title, adminUser.language) }*\n${ TAPi18n.__(alert.text, ...alert.textArguments || [], adminUser.language) }\n${ alert.infoUrl }`,
})),
banners: alerts.map((alert) => ({
id: `alert-${ alert.id }`,
id: `alert-${ alert.id }`.replace(/\./g, '_'),
priority: 10,
title: alert.title,
text: alert.text,

@ -2,7 +2,6 @@ import os from 'os';
import { HTTP } from 'meteor/http';
import { check, Match } from 'meteor/check';
import { MongoInternals } from 'meteor/mongo';
import { Settings } from '../../../models';
import { Info } from '../../../utils';
@ -11,14 +10,11 @@ import { getWorkspaceAccessToken } from '../../../cloud/server';
export default () => {
try {
const uniqueID = Settings.findOne('uniqueID');
const { _oplogHandle } = MongoInternals.defaultRemoteCollectionDriver().mongo;
const oplogEnabled = _oplogHandle && _oplogHandle.onOplogEntry;
const params = {
uniqueId: uniqueID.value,
installedAt: uniqueID.createdAt,
installedAt: uniqueID.createdAt.toJSON(),
version: Info.version,
oplogEnabled,
osType: os.type(),
osPlatform: os.platform(),
osArch: os.arch(),
@ -40,7 +36,11 @@ export default () => {
});
check(data, Match.ObjectIncluding({
versions: [String],
versions: [Match.ObjectIncluding({
version: Match.Optional(String),
security: Match.Optional(Boolean),
infoUrl: Match.Optional(String),
})],
alerts: Match.Optional([Match.ObjectIncluding({
id: Match.Optional(String),
title: Match.Optional(String),

Loading…
Cancel
Save