Update electron to 15.3.0

This commit is contained in:
Fedor Indutny 2021-11-08 22:43:37 +01:00 committed by GitHub
parent 7de340a104
commit 519ca05911
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 525 additions and 2393 deletions

View file

@ -4,12 +4,11 @@
import { ipcRenderer } from 'electron';
import { explodePromise } from './util/explodePromise';
import { SECOND } from './util/durations';
import * as log from './logging/log';
type ResolveType = (data: unknown) => void;
export const electronRequire = require;
export class CI {
private readonly eventListeners = new Map<string, Array<ResolveType>>();
@ -21,7 +20,10 @@ export class CI {
});
}
public async waitForEvent(event: string): Promise<unknown> {
public async waitForEvent(
event: string,
timeout = 60 * SECOND
): Promise<unknown> {
const pendingCompleted = this.completedEvents.get(event) || [];
const pending = pendingCompleted.shift();
if (pending) {
@ -35,7 +37,11 @@ export class CI {
}
log.info(`CI: waiting for event ${event}`);
const { resolve, promise } = explodePromise();
const { resolve, reject, promise } = explodePromise();
const timer = setTimeout(() => {
reject(new Error('Timed out'));
}, timeout);
let list = this.eventListeners.get(event);
if (!list) {
@ -43,7 +49,10 @@ export class CI {
this.eventListeners.set(event, list);
}
list.push(resolve);
list.push((value: unknown) => {
clearTimeout(timer);
resolve(value);
});
return promise;
}

View file

@ -400,8 +400,8 @@ function doRecordsConflict(
}
// If both types are Long we can use Long's equals to compare them
if (localValue instanceof Long || typeof localValue === 'number') {
if (!(remoteValue instanceof Long) || typeof remoteValue !== 'number') {
if (Long.isLong(localValue) || typeof localValue === 'number') {
if (!Long.isLong(remoteValue) || typeof remoteValue !== 'number') {
return true;
}

View file

@ -57,7 +57,7 @@ describe('WebSocket-Resource', () => {
assert.strictEqual(message.response?.status, 200);
const id = message.response?.id;
if (id instanceof Long) {
if (Long.isLong(id)) {
assert(id.equals(requestId));
} else {
assert(false, `id should be Long, got ${id}`);

View file

@ -43,7 +43,7 @@ export function processAttachment(
}
const { cdnId } = attachment;
const hasCdnId = cdnId instanceof Long ? !cdnId.isZero() : Boolean(cdnId);
const hasCdnId = Long.isLong(cdnId) ? !cdnId.isZero() : Boolean(cdnId);
return {
...shallowDropNull(attachment),

File diff suppressed because it is too large Load diff

View file

@ -110,7 +110,9 @@ const excludedFilesRegexp = RegExp(
'^node_modules/@webassemblyjs/.+',
'^node_modules/@electron/.+',
'^node_modules/ajv/.+',
'^node_modules/ajv-keywords/.+',
'^node_modules/amdefine/.+',
'^node_modules/ansi-styles/.+',
'^node_modules/ansi-colors/.+',
'^node_modules/anymatch/.+',
'^node_modules/app-builder-lib/.+',
@ -122,6 +124,7 @@ const excludedFilesRegexp = RegExp(
'^node_modules/bluebird/.+',
'^node_modules/body-parser/.+',
'^node_modules/bower/.+',
'^node_modules/braces/.+',
'^node_modules/buble/.+',
'^node_modules/builder-util-runtime/.+',
'^node_modules/builder-util/.+',
@ -138,6 +141,7 @@ const excludedFilesRegexp = RegExp(
'^node_modules/css-selector-tokenizer/.+',
'^node_modules/css-tree/.+',
'^node_modules/csso/.+',
'^node_modules/default-gateway/.+',
'^node_modules/degenerator/.+',
'^node_modules/detect-port-alt/.+',
'^node_modules/dmg-builder/.+',
@ -160,6 +164,7 @@ const excludedFilesRegexp = RegExp(
'^node_modules/file-system-cache/.+', // Currently only used in storybook
'^node_modules/finalhandler/.+',
'^node_modules/fsevents/.+',
'^node_modules/global-agent/.+',
'^node_modules/globule/.+',
'^node_modules/grunt-cli/.+',
'^node_modules/grunt-contrib-concat/.+',
@ -183,13 +188,17 @@ const excludedFilesRegexp = RegExp(
'^node_modules/jsdoc/.+',
'^node_modules/jss-global/.+',
'^node_modules/jss/.+',
'^node_modules/liftup/.+',
'^node_modules/livereload-js/.+',
'^node_modules/lolex/.+',
'^node_modules/log-symbols/.+',
'^node_modules/magic-string/.+',
'^node_modules/markdown-it/.+',
'^node_modules/meow/.+',
'^node_modules/minimatch/.+',
'^node_modules/mocha/.+',
'^node_modules/nise/.+',
'^node_modules/node-gyp/.+',
'^node_modules/node-sass-import-once/.+',
'^node_modules/node-sass/.+',
'^node_modules/npm-run-all/.+',
@ -214,6 +223,7 @@ const excludedFilesRegexp = RegExp(
'^node_modules/resolve/.+',
'^node_modules/sass-graph/.+',
'^node_modules/sass-loader/.+',
'^node_modules/schema-utils/.+',
'^node_modules/scss-tokenizer/.+',
'^node_modules/send/.+',
'^node_modules/serve-index/.+',
@ -251,6 +261,7 @@ const excludedFilesRegexp = RegExp(
'^node_modules/yargs/.+',
'^node_modules/find-yarn-workspace-root/.+',
'^node_modules/update-notifier/.+',
'^node_modules/windows-release/.+',
// Used by Storybook
'^node_modules/@emotion/.+',