Skip to content

Safe way to generate ULID without possible error? #216

@carolynvs

Description

@carolynvs

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! ✊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions