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

added auto-regen for duplicate uuids #342

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

jhuang38
Copy link
Contributor

Description

Give new UUID to instance config if UUID already exists. In dashboard, duplicate names will show up:
image

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Note: make sure your files are formatted with rust-analyzer

@jhuang38 jhuang38 requested a review from CheatCod August 27, 2023 19:13
@netlify
Copy link

netlify bot commented Aug 27, 2023

Deploy Preview for lodestone-dashboard canceled.

Name Link
🔨 Latest commit b969441
🔍 Latest deploy log https://app.netlify.com/sites/lodestone-dashboard/deploys/64eee60c36437d0008faef21

@netlify
Copy link

netlify bot commented Aug 27, 2023

Deploy Preview for lodestone-storybook canceled.

Name Link
🔨 Latest commit b969441
🔍 Latest deploy log https://app.netlify.com/sites/lodestone-storybook/deploys/64eee60cfd33f1000732dfe6

core/src/lib.rs Outdated
info!("Instance with duplicate UUID {} updated to new UUID {}", uuid_string, dot_lodestone_config.uuid().to_string());
},
Err(e) => {
info!("Error with regenerating duplicate UUID {}, {}", uuid_string, e);
Copy link
Member

Choose a reason for hiding this comment

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

these logs should be warn and error

core/src/lib.rs Outdated
@@ -160,6 +162,36 @@ async fn restore_instances(
};

debug!("restoring instance: {}", path.display());

// regenerate duplicate UUID
let uuid = dot_lodestone_config.uuid().to_owned();
Copy link
Member

Choose a reason for hiding this comment

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

is this to_owned() call neccessary?

@jhuang38 jhuang38 requested a review from CheatCod August 30, 2023 06:47
@jhuang38 jhuang38 self-assigned this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants