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

Consider how to avoid the need for an unwrap of error properties #12

Open
lawrence-forooghian opened this issue Aug 15, 2024 · 0 comments
Labels
enhancement New feature or improved functionality.

Comments

@lawrence-forooghian
Copy link
Collaborator

lawrence-forooghian commented Aug 15, 2024

The RoomStatus and ConnectionStatus types introduced in #9 are currently just copied from the JS type. They have a current state property and an optional error property. I believe that error is guaranteed to be non-nil for certain values of current, so it should be possible for us to design an API that doesn't require an unwrap of error in those cases (i.e. make the error an associated value of the state enum). To do this, we first of all need to understand in which states the error is:

  • guaranteed to be populated
  • possibly populated
  • never populated

(Ditto for the corresponding *StateChange types.)

┆Issue is synchronized with this Jira Story by Unito

@lawrence-forooghian lawrence-forooghian added the enhancement New feature or improved functionality. label Aug 15, 2024
lawrence-forooghian added a commit that referenced this issue Oct 10, 2024
Lifecycle statuses have an error if and only if they have certain cases,
so encode this constraint in the type system to avoid unnecessary
unwraps.

Part of #12.
lawrence-forooghian added a commit that referenced this issue Oct 10, 2024
Lifecycle statuses have an error if and only if they have certain cases,
so encode this constraint in the type system to avoid unnecessary
unwraps.

Part of #12.
lawrence-forooghian added a commit that referenced this issue Oct 15, 2024
Lifecycle statuses have an error if and only if they have certain cases,
so encode this constraint in the type system to avoid unnecessary
unwraps.

Part of #12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

No branches or pull requests

1 participant