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

Safe way to generate ULID without possible error? #216

Open
carolynvs opened this issue Jun 2, 2020 · 0 comments
Open

Safe way to generate ULID without possible error? #216

carolynvs opened this issue Jun 2, 2020 · 0 comments

Comments

@carolynvs
Copy link
Contributor

I'm concerned about our current code for generating ULIDs. Previously the code could panic, and had another unrelated bug so when I updated it I added a function that returned (string, error) and started using that so at least we could handle the error.

Is there any way we can get to a place where we are using ULIDs and not relying on code that panics or can error?

We rely on ULIDs to store important data, without it we can't store the data at all, and not knowing if we can store it and possibly having to either panic or just have the calling tool log an error is unacceptable.

Random Ideas

  • Are there other libraries that we can use?
  • Can we use a different entropy source that couldn't return an error?
  • Fork and create a safe path?
  • Write our own?
  • ???

I'm working on a ugly as all workaround for now but really we shouldn't be putting in hacks because of a flaw in a critical library. So I need your help to come up with a solution! ✊

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

No branches or pull requests

1 participant