-
Notifications
You must be signed in to change notification settings - Fork 30
Reproducible IDs #1335
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
Reproducible IDs #1335
Conversation
Generate the ID based on a stable unique attribute
|
||
/// Used to identify the navigation for the current compilation | ||
/// We want to reset users sessionStorage every time this changes to invalidate | ||
/// the guids that no longer exist | ||
public static string CurrentNavigationId { get; } = Guid.NewGuid().ToString("N")[..8]; |
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.
I removed this entirely. Since it's original purpose doesn't exist anymore.
(persistent navigation state)
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.
LGTM maybe we want to stick this in like a ShortId.Create(params string[] components)
shared helper?
Will leave that up to you, LGTM!
GroupsInOrder = groups; | ||
FilesInOrder = files; | ||
NavigationItems = navigationItems; | ||
Id = Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(FolderName + depth)))[..8]; |
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.
Not entirely unique, we might want to pass parent folder down the chain to concatenate a /unique/path/to/this/folder
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.
I'm happy to accept the risk of clashes for now and follow up with another PR.
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.
Ahh 3c66ec3 :)
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.
Yup. Just noticed :D
a061fbe
to
830ab85
Compare
SGTM! |
Generate the ID based on a stable unique attribute.
This will also help achieve #1334