Migration: add a warning about mtime missing when migrating.

master
Tom Hacohen 4 years ago
parent 9e9206e690
commit 6475a8e343

@ -405,6 +405,7 @@ export function WizardMigrationPage(props: OurPagePropsType) {
setProgress(""); setProgress("");
try { try {
let malformed = 0; let malformed = 0;
let badMtime = 0;
const etebase = props.etebase!; const etebase = props.etebase!;
const colMgr = etebase.getCollectionManager(); const colMgr = etebase.getCollectionManager();
@ -471,14 +472,19 @@ export function WizardMigrationPage(props: OurPagePropsType) {
prevUid = entry.uid; prevUid = entry.uid;
const pimItem = parseFunc(syncEntry.content); const pimItem = parseFunc(syncEntry.content);
const uid = pimItem.uid; const uid = pimItem.uid;
// When we can't set mtime, set to the item's position in the change log so we at least maintain EteSync 1.0 ordering.
const mtime = (pimItem.lastModified?.toJSDate())?.getTime() ?? now + done;
if (!uid) { if (!uid) {
malformed++; malformed++;
continue; continue;
} }
// When we can't set mtime, set to the item's position in the change log so we at least maintain EteSync 1.0 ordering.
let mtime = (pimItem.lastModified?.toJSDate())?.getTime();
if (!mtime) {
mtime = now + done;
badMtime++;
}
let item = items.get(uid); let item = items.get(uid);
if (item) { if (item) {
// Existing item // Existing item
@ -509,10 +515,14 @@ export function WizardMigrationPage(props: OurPagePropsType) {
} }
await etebase.logout(); await etebase.logout();
if (malformed > 0) { {
setProgress(`Done\nIgnored ${malformed} entries (probably safe to ignore)`); let out = "Done";
} else { if (badMtime > 0) {
setProgress("Done"); out += `\nModification time missing for ${badMtime} entries (setting to "now")`;
} else if (malformed > 0) {
out += `\nIgnored ${malformed} entries (probably safe to ignore)`;
}
setProgress(out);
} }
setDone(true); setDone(true);

Loading…
Cancel
Save