Skip to content
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

fix: keep notification and heartbeat records when import backup with … #3000

Conversation

SunnyDoraemon
Copy link

@SunnyDoraemon SunnyDoraemon commented Mar 30, 2023

…overwrite mode

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Fixes #677

Type of change

Please delete any options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.

@SunnyDoraemon
Copy link
Author

Is this PR has any problem there?,should I cancel it?

@chakflying
Copy link
Collaborator

What you implemented is not only a fix (which there was already a PR open), but also a breaking change to the behavior of overwrite mode without previous discussion.

@Saibamen
Copy link
Contributor

Related PR (already merged to fix #677): #2871

@louislam louislam added the question Further information is requested label Jul 14, 2023
monitorsIdList = monitorsIdList.map((item) => {
return item.id;
});
log.info("manage", "Import Backup with 'overwrite mode. now remove the monitors which is not in backup json'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.info("manage", "Import Backup with 'overwrite mode. now remove the monitors which is not in backup json'");
log.info("manage", "Import Backup with 'overwrite mode'. Now remove the monitors which is not in backup JSON'");

monitorsIdList.splice(idx, 1);
}
}
log.info("manage", `Need OverWrite Monitors Id List:[${needOverWriteMonitorsIdList}],Length:${needOverWriteMonitorsIdList.length}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.info("manage", `Need OverWrite Monitors Id List:[${needOverWriteMonitorsIdList}],Length:${needOverWriteMonitorsIdList.length}`);
log.info("manage", `Need OverWrite Monitors Id List: [${needOverWriteMonitorsIdList}], Length:${needOverWriteMonitorsIdList.length}`);

// delete old same monitor item with expired id
await R.exec("DELETE FROM monitor where id= ? ", monitorListData[i].id);
} else {
log.info("manage", `[BackUp OverWrite Mode] Find new monitor Join - name:${monitorListData[i].name}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.info("manage", `[BackUp OverWrite Mode] Find new monitor Join - name:${monitorListData[i].name}`);
log.info("manage", `[BackUp OverWrite Mode] Find new monitor Join - name: ${monitorListData[i].name}`);

@CommanderStorm CommanderStorm mentioned this pull request Oct 29, 2023
@chakflying
Copy link
Collaborator

Obsolete as the backup feature has been dropped in #3892.

@chakflying chakflying closed this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When importing a backup, the notificationIDList is not saved
4 participants