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

move to nanoid for tenant, user, apps! #275

Merged
merged 4 commits into from
May 22, 2024
Merged

move to nanoid for tenant, user, apps! #275

merged 4 commits into from
May 22, 2024

Conversation

wtfsayo
Copy link
Contributor

@wtfsayo wtfsayo commented May 22, 2024

No description provided.

@wtfsayo wtfsayo requested a review from plor May 22, 2024 03:53
Copy link
Contributor

@plor plor left a comment

Choose a reason for hiding this comment

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

I would prefer if a change like this was documented better. For example referencing https://zelark.github.io/nano-id-cc/ to show what the probability of collision is.

@@ -83,6 +84,7 @@ export class AppsService {
if (!tenants) return;
const newApp = await this.prisma.client.app.create({
data: {
id: nanoid(10),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any implications of 10 here? I'm not familiar with nanoid, so not sure what benefit this has over 9, or what would be gained by going to 11. This is the type of decision that is good to document so future devs know what's going on. I'd recommend making a constant since this is used in several places (2), and the constant can be named and commented appropriately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://zelark.github.io/nano-id-cc/

10 character is strong enough to not repeat !

@wtfsayo wtfsayo requested a review from plor May 22, 2024 17:20
Copy link
Contributor

@plor plor left a comment

Choose a reason for hiding this comment

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

Thanks.

@wtfsayo wtfsayo merged commit 8b2b19e into develop May 22, 2024
@wtfsayo wtfsayo deleted the nanoid-update branch May 22, 2024 17:34
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