From 3e2d575506af019773adf67546a2a1c8fcabcad0 Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Tue, 27 Mar 2018 12:19:40 -0400 Subject: [PATCH] Document `MessageDataMigrator` module design --- js/modules/messages_data_migrator.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/modules/messages_data_migrator.js b/js/modules/messages_data_migrator.js index 50508c3d3..8142922be 100644 --- a/js/modules/messages_data_migrator.js +++ b/js/modules/messages_data_migrator.js @@ -1,5 +1,12 @@ /* eslint-env browser */ +// Module to upgrade the schema of messages, e.g. migrate attachments to disk. +// `processAll` is meant to be run after the initial database migrations +// (12 – 17) and purposely doesn’t rely on our Backbone IndexedDB adapter to +// prevent subsequent migrations to run (18+) but rather uses direct IndexedDB +// access. This includes avoiding usage of `storage` module which uses Backbone +// under the hood. + const isFunction = require('lodash/isFunction'); const isNumber = require('lodash/isNumber'); const isObject = require('lodash/isObject');