mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Introduce mandatary migration on startup, to minimum version
This commit is contained in:
@@ -296,6 +296,7 @@ exports.upgradeSchema = async (
|
||||
makeImageThumbnail,
|
||||
makeVideoScreenshot,
|
||||
logger,
|
||||
maxVersion = exports.CURRENT_SCHEMA_VERSION,
|
||||
} = {}
|
||||
) => {
|
||||
if (!isFunction(writeNewAttachmentData)) {
|
||||
@@ -328,7 +329,12 @@ exports.upgradeSchema = async (
|
||||
|
||||
let message = rawMessage;
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const currentVersion of VERSIONS) {
|
||||
for (let index = 0, max = VERSIONS.length; index < max; index += 1) {
|
||||
if (maxVersion < index) {
|
||||
break;
|
||||
}
|
||||
|
||||
const currentVersion = VERSIONS[index];
|
||||
// We really do want this intra-loop await because this is a chained async action,
|
||||
// each step dependent on the previous
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
|
||||
Reference in New Issue
Block a user