Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BryonLewis
Copy link
Collaborator

Event Color wasn't updating properly, this will fix the issue.

Copy link
Member

@waxlamp waxlamp left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix.

Shouldn't typechecking have caught this bug?

@BryonLewis
Copy link
Collaborator Author

Shouldn't typechecking have caught this bug?

The old function returned back an array of [string, number], where string was the Type and the number was the confidence pair. The new one follows the naming more literally and returns the 'Type' string. So taking the first index of a string technically means it is still a string just of length 1. In the example email for the bug all of the types that were visible started with the same letter 'p' so all color mapping was mapped to the same color. So it wasn't using the full name of the type for colors.

@BryonLewis BryonLewis merged commit af09403 into main Dec 19, 2022
@BryonLewis BryonLewis deleted the fix-event-color branch December 19, 2022 14:46
@waxlamp
Copy link
Member

waxlamp commented Dec 19, 2022

Shouldn't typechecking have caught this bug?

The old function returned back an array of [string, number], where string was the Type and the number was the confidence pair. The new one follows the naming more literally and returns the 'Type' string. So taking the first index of a string technically means it is still a string just of length 1. In the example email for the bug all of the types that were visible started with the same letter 'p' so all color mapping was mapped to the same color. So it wasn't using the full name of the type for colors.

I've been watching too many domain-driven design youtube videos, so my immediate thought is whether we can use the type system to enforce better constraints on these kinds of values. Something like TypeScript's type predicates or something like that... just something to think about.

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