Skip to content

Conversation

reakaleek
Copy link
Member

@reakaleek reakaleek commented Jun 3, 2025

Generate the ID based on a stable unique attribute.

This will also help achieve #1334

Generate the ID based on a stable unique attribute
@reakaleek reakaleek requested a review from a team as a code owner June 3, 2025 08:51
@reakaleek reakaleek self-assigned this Jun 3, 2025
Comment on lines -49 to -53

/// 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];
Copy link
Member Author

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)

Copy link
Member

@Mpdreamz Mpdreamz left a 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];
Copy link
Member

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

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh 3c66ec3 :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. Just noticed :D

@reakaleek reakaleek force-pushed the feature/reproducible-ids branch from a061fbe to 830ab85 Compare June 3, 2025 09:35
@reakaleek
Copy link
Member Author

LGTM maybe we want to stick this in like a ShortId.Create(params string[] components) shared helper?

Will leave that up to you, LGTM!

SGTM!

830ab85

@reakaleek reakaleek enabled auto-merge (squash) June 3, 2025 09:39
@reakaleek reakaleek merged commit e787974 into main Jun 3, 2025
15 checks passed
@reakaleek reakaleek deleted the feature/reproducible-ids branch June 3, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants