Better database errors in worker thread

This commit is contained in:
Fedor Indutny 2024-08-13 13:42:20 -07:00 committed by GitHub
parent 2cbc1a82b2
commit 6143888f6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 additions and 8 deletions

View file

@ -117,7 +117,6 @@ import { load as loadLocale } from './locale';
import type { LoggerType } from '../ts/types/Logging';
import { HourCyclePreference } from '../ts/types/I18N';
import { ScreenShareStatus } from '../ts/types/Calling';
import { DBVersionFromFutureError } from '../ts/sql/migrations';
import type { ParsedSignalRoute } from '../ts/util/signalRoutes';
import { parseSignalRoute } from '../ts/util/signalRoutes';
import * as dns from '../ts/util/dns';
@ -1800,7 +1799,9 @@ const onDatabaseError = async (error: Error) => {
const copyErrorAndQuitButtonIndex = 0;
const SIGNAL_SUPPORT_LINK = 'https://support.signal.org/error';
if (error instanceof DBVersionFromFutureError) {
// Note that this error is thrown by the worker process and thus instanceof
// check won't work.
if (error.name === 'DBVersionFromFutureError') {
// If the DB version is too new, the user likely opened an older version of Signal,
// and they would almost never want to delete their data as a result, so we don't show
// that option