Skip to content

LG-10525: Refactor AcuantContext#9900

Merged
eileen-nava merged 6 commits intomainfrom
em/10525-refactor-acuant-context
Jan 12, 2024
Merged

LG-10525: Refactor AcuantContext#9900
eileen-nava merged 6 commits intomainfrom
em/10525-refactor-acuant-context

Conversation

@eileen-nava
Copy link
Contributor

🎫 Ticket

Link to the relevant ticket:
LG-10525

🛠 Summary of changes

My goal was to reduce the confusing discrepancy between the threshold of 50, which we get from the backend, and the front-end constants of DEFAULT_ACCEPTABLE_GLARE_SCORE and DEFAULT_ACCEPTABLE_SHARPNESS_SCORE, which were set to 30. I wanted to remove those constants, but I am now thinking it may be better to leave them and just change them to 50. Slack context here.

@eileen-nava eileen-nava requested review from a team, aduth and amirbey and removed request for a team January 10, 2024 19:32
Comment on lines +554 to +555
const isAssessedAsGlare = glare < glareThreshold!;
const isAssessedAsBlurry = sharpness < sharpnessThreshold!;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be hesitant to use the ! operator here if we're building in the expectation that the value may be null.

Instead, maybe we should explicitly handle the scenario that the value is in-fact null, e.g. !!glareThreshold && glare < glareThreshold;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I agree, using the ! operator here made me antsy. I like the approach you suggested and will try it, thanks!

@eileen-nava eileen-nava requested a review from aduth January 11, 2024 16:41
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

I haven't actually verified that we do populate these options in all scenarios already, but assuming we do, LGTM 👍

@aduth
Copy link
Contributor

aduth commented Jan 11, 2024

I haven't actually verified that we do populate these options in all scenarios already

I assume that's what's happening here, and that the configs are never overridden to be explicitly null.

glare_threshold: IdentityConfig.store.doc_auth_client_glare_threshold,
sharpness_threshold: IdentityConfig.store.doc_auth_client_sharpness_threshold,

Copy link
Contributor

@amirbey amirbey left a comment

Choose a reason for hiding this comment

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

LGTM!

@eileen-nava eileen-nava merged commit 81d8b86 into main Jan 12, 2024
@eileen-nava eileen-nava deleted the em/10525-refactor-acuant-context branch January 12, 2024 16:15
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.

3 participants