-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add more logs to migrations and create a settings backup #1036
Conversation
server/lib/settings/migrator.ts
Outdated
} else if (oldBackup) { | ||
// no migration occured | ||
// we save the old backup (to avoid settings.json and settings.old.json being the same) | ||
fs.writeFileSync(BACKUP_PATH, oldBackup.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once again, fs.promises
.
} else if (oldBackup) { | |
// no migration occured | |
// we save the old backup (to avoid settings.json and settings.old.json being the same) | |
fs.writeFileSync(BACKUP_PATH, oldBackup.toString()); | |
await fs.promises.writeFile(SETTINGS_PATH, JSON.stringify(migrated, null, 2)); |
Would it be better to parse this json with type safety?
const fileSaved = JSON.parse(await fs.promises.readFile(SETTINGS_PATH, 'utf-8')) as AllSettings;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could but I don't really see the point of this since this variable is only used once to be compared after being stringified.
We can ignore the broken cypress test. That is because trending api is broken and it's currently showing people instead of media |
Fixed some of your comments. |
…nbagel#1036) * feat: add more logs to migrations and create a settings backup * fix: avoid backup to be replaced at next startup * fix: resolve review comments * fix: try to fix CodeQL warnings
🎉 This PR is included in version 2.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Description
Screenshot (if UI-related)
To-Dos
pnpm build
pnpm i18n:extract
Issues Fixed or Closed