A set of fixes and upgrades
* writeToDownloads: Add missing await * Remove window.isFocused() - not used anywhere! * Update typescript, p-queue, make necessary changes to fix build * Slow down sender certificate retries with no existing cert * Slow down signed prekey refreshes when unlinked - 5s -> 5m * Update protobufjs to 4.1.2
This commit is contained in:
parent
38c7fa3da6
commit
3938eb9801
15 changed files with 4824 additions and 3975 deletions
|
@ -189,7 +189,7 @@ exports.writeToDownloads = async ({ data, name }) => {
|
|||
throw new Error('Invalid filename!');
|
||||
}
|
||||
|
||||
writeWithAttributes(normalized, Buffer.from(data));
|
||||
await writeWithAttributes(normalized, Buffer.from(data));
|
||||
|
||||
return {
|
||||
fullPath: normalized,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const electron = require('electron');
|
||||
const Queue = require('p-queue');
|
||||
const Queue = require('p-queue').default;
|
||||
const sql = require('./sql');
|
||||
const { remove: removeUserConfig } = require('./user_config');
|
||||
const { remove: removeEphemeralConfig } = require('./ephemeral_config');
|
||||
|
|
8726
components/protobuf/dist/ProtoBuf.js
vendored
8726
components/protobuf/dist/ProtoBuf.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -35,7 +35,7 @@ function initialize({ events, storage, navigator, logger }) {
|
|||
const now = Date.now();
|
||||
const certificate = storage.get('senderCertificate');
|
||||
if (!certificate) {
|
||||
setTimeoutForNextRun(now);
|
||||
setTimeoutForNextRun(scheduledTime || now);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ function initialize({ events, storage, navigator, logger }) {
|
|||
scheduleNextRotation();
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
'refreshSenderCertificate: Get failed. Trying again in two minutes...',
|
||||
'refreshSenderCertificate: Get failed. Trying again in five minutes...',
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ const BLESSED_PACKS = {
|
|||
|
||||
const { isNumber, pick, reject, groupBy, values } = require('lodash');
|
||||
const pMap = require('p-map');
|
||||
const Queue = require('p-queue');
|
||||
const Queue = require('p-queue').default;
|
||||
const qs = require('qs');
|
||||
|
||||
const { makeLookup } = require('../../ts/util/makeLookup');
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
setTimeoutForNextRun();
|
||||
} catch (error) {
|
||||
window.log.error(
|
||||
'rotateSignedPrekey() failed. Trying again in five seconds'
|
||||
'rotateSignedPrekey() failed. Trying again in five minutes'
|
||||
);
|
||||
setTimeout(setTimeoutForNextRun, 5000);
|
||||
setTimeout(setTimeoutForNextRun, 5 * 60 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
"node-gyp": "5.0.3",
|
||||
"os-locale": "2.1.0",
|
||||
"p-map": "2.1.0",
|
||||
"p-queue": "5.0.0",
|
||||
"p-queue": "6.2.1",
|
||||
"pify": "3.0.0",
|
||||
"protobufjs": "6.8.6",
|
||||
"proxy-agent": "3.0.3",
|
||||
|
@ -244,7 +244,7 @@
|
|||
"tslint-microsoft-contrib": "6.2.0",
|
||||
"tslint-react": "3.6.0",
|
||||
"typed-scss-modules": "0.0.11",
|
||||
"typescript": "3.3.3333",
|
||||
"typescript": "3.7.4",
|
||||
"webpack": "4.39.2",
|
||||
"webpack-cli": "3.3.7",
|
||||
"webpack-dev-server": "3.8.0"
|
||||
|
|
|
@ -11,9 +11,6 @@ const { remote } = electron;
|
|||
const { app } = remote;
|
||||
const { systemPreferences } = remote.require('electron');
|
||||
|
||||
const browserWindow = remote.getCurrentWindow();
|
||||
window.isFocused = () => browserWindow.isFocused();
|
||||
|
||||
// Waiting for clients to implement changes on receive side
|
||||
window.TIMESTAMP_VALIDATION = false;
|
||||
window.PAD_ALL_ATTACHMENTS = false;
|
||||
|
@ -267,7 +264,7 @@ window.getGuid = require('uuid/v4');
|
|||
window.React = require('react');
|
||||
window.ReactDOM = require('react-dom');
|
||||
window.moment = require('moment');
|
||||
window.PQueue = require('p-queue');
|
||||
window.PQueue = require('p-queue').default;
|
||||
|
||||
const Signal = require('./js/modules/signal');
|
||||
const i18n = require('./js/modules/i18n');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as React from 'react';
|
||||
import * as PQueue from 'p-queue';
|
||||
import PQueue from 'p-queue';
|
||||
import {
|
||||
SortableContainer,
|
||||
SortableElement,
|
||||
|
|
|
@ -17,7 +17,7 @@ window.PROTO_ROOT = '../../protos';
|
|||
window.getEnvironment = () => config.environment;
|
||||
window.getVersion = () => config.version;
|
||||
window.getGuid = require('uuid/v4');
|
||||
window.PQueue = require('p-queue');
|
||||
window.PQueue = require('p-queue').default;
|
||||
|
||||
window.localeMessages = ipc.sendSync('locale-data');
|
||||
|
||||
|
|
|
@ -188,10 +188,6 @@ export class Lightbox extends React.Component<Props, State> {
|
|||
public readonly focusRef = React.createRef<HTMLDivElement>();
|
||||
public previousFocus: any;
|
||||
|
||||
public state = {
|
||||
videoTime: undefined,
|
||||
};
|
||||
|
||||
public componentDidMount() {
|
||||
this.previousFocus = document.activeElement;
|
||||
|
||||
|
@ -299,7 +295,7 @@ export class Lightbox extends React.Component<Props, State> {
|
|||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
{isViewOnce && is.number(videoTime) ? (
|
||||
{isViewOnce && videoTime && is.number(videoTime) ? (
|
||||
<div style={styles.navigationContainer}>
|
||||
<div style={styles.timestampPill}>{formatDuration(videoTime)}</div>
|
||||
</div>
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
} from './EmojiPicker';
|
||||
import { LocalizerType } from '../../types/Util';
|
||||
|
||||
export type EmojiPickDataType = EmojiPickDataType;
|
||||
export { EmojiPickDataType };
|
||||
|
||||
export type OwnProps = {
|
||||
readonly i18n: LocalizerType;
|
||||
|
|
|
@ -91,7 +91,7 @@ export const EmojiPicker = React.memo(
|
|||
|
||||
const debounceSearchChange = React.useMemo(
|
||||
() =>
|
||||
debounce(query => {
|
||||
debounce((query: string) => {
|
||||
setSearchText(query);
|
||||
setScrollToRow(0);
|
||||
}, 200),
|
||||
|
|
|
@ -37,12 +37,15 @@ interface ShimmedWindow extends Window {
|
|||
ConversationController: ConversationControllerType;
|
||||
}
|
||||
|
||||
const unknownWindow = window as unknown;
|
||||
const shimmedWindow = unknownWindow as ShimmedWindow;
|
||||
|
||||
export function sendStickerPackSync(
|
||||
packId: string,
|
||||
packKey: string,
|
||||
installed: boolean
|
||||
) {
|
||||
const { ConversationController, textsecure, log } = window as ShimmedWindow;
|
||||
const { ConversationController, textsecure, log } = shimmedWindow;
|
||||
const ourNumber = textsecure.storage.user.getNumber();
|
||||
const { wrap, sendOptions } = ConversationController.prepareForSend(
|
||||
ourNumber,
|
||||
|
|
31
yarn.lock
31
yarn.lock
|
@ -6595,6 +6595,11 @@ eventemitter3@^3.1.0:
|
|||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163"
|
||||
integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==
|
||||
|
||||
eventemitter3@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.0.tgz#d65176163887ee59f386d64c82610b696a4a74eb"
|
||||
integrity sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==
|
||||
|
||||
events@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88"
|
||||
|
@ -11670,12 +11675,13 @@ p-map@^1.1.1:
|
|||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b"
|
||||
|
||||
p-queue@5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-5.0.0.tgz#80f1741d5e78a6fa72fce889406481baa5617a3c"
|
||||
integrity sha512-6QfeouDf236N+MAxHch0CVIy8o/KBnmhttKjxZoOkUlzqU+u9rZgEyXH3OdckhTgawbqf5rpzmyR+07+Lv0+zg==
|
||||
p-queue@6.2.1:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.2.1.tgz#809a832046451b2240a0a8e48b4fa18192b22b64"
|
||||
integrity sha512-wV8yC/rkuWpgu9LGKJIb48OynYSrE6lVl2Bx6r8WjbyVKrFAzzQ/QevAvwnDjlD+mLt8xy0LTDOU1freOvMTCg==
|
||||
dependencies:
|
||||
eventemitter3 "^3.1.0"
|
||||
eventemitter3 "^4.0.0"
|
||||
p-timeout "^3.1.0"
|
||||
|
||||
p-retry@^3.0.1:
|
||||
version "3.0.1"
|
||||
|
@ -11690,6 +11696,13 @@ p-timeout@^2.0.1:
|
|||
dependencies:
|
||||
p-finally "^1.0.0"
|
||||
|
||||
p-timeout@^3.1.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe"
|
||||
integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==
|
||||
dependencies:
|
||||
p-finally "^1.0.0"
|
||||
|
||||
p-try@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
|
||||
|
@ -16151,10 +16164,10 @@ typeface-inter@3.10.0:
|
|||
resolved "https://registry.yarnpkg.com/typeface-inter/-/typeface-inter-3.10.0.tgz#04a55d62e2dc3f60db3afab5d8a547e067692bc6"
|
||||
integrity sha512-WuXE+TaJLB8pdMuvIVY3LfT5UQqndR8+Js0xfhNpdXlsEx0Abwd1bzg4w4YWl2eoOmmLYrRpx6UJJ7a7/q6wZQ==
|
||||
|
||||
typescript@3.3.3333:
|
||||
version "3.3.3333"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3333.tgz#171b2c5af66c59e9431199117a3bcadc66fdcfd6"
|
||||
integrity sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==
|
||||
typescript@3.7.4:
|
||||
version "3.7.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19"
|
||||
integrity sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==
|
||||
|
||||
ua-parser-js@^0.7.18:
|
||||
version "0.7.19"
|
||||
|
|
Loading…
Add table
Reference in a new issue