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

refactor(discovery-client,app-shell): prefer manual address entries in health poller #12734

Merged
merged 2 commits into from
May 22, 2023

Conversation

brenthagen
Copy link
Contributor

Overview

to allow updating existing address entries in the health poller manually, the getAddresses selector and discovery-client health poller are updated to prefer manual address entries

closes RCORE-763

Test Plan

  • manually confirmed discovery-client registers robots as available and unavailable to usb attach and detach

Changelog

  • Updates discovery-client to prefer manual address entries in health poller

Review requests

  • confirm soundness of set logic changes
  • confirm discovery still works as intended

Risk assessment

medium-ish, changes health poller logic

…n health poller

to allow updating existing address entries in the health poller manually, the getAddresses selector
and discovery-client health poller are updated to prefer manual address entries

closes RCORE-763
@brenthagen brenthagen requested a review from a team as a code owner May 18, 2023 15:28
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #12734 (39a7d0c) into edge (729fa47) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #12734   +/-   ##
=======================================
  Coverage   73.37%   73.37%           
=======================================
  Files        2264     2264           
  Lines       61506    61524   +18     
  Branches     6775     6794   +19     
=======================================
+ Hits        45130    45146   +16     
+ Misses      14760    14756    -4     
- Partials     1616     1622    +6     
Flag Coverage Δ
app 71.78% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
app-shell/src/discovery.ts 85.18% <ø> (+9.77%) ⬆️

... and 3 files with indirect coverage changes

@brenthagen brenthagen removed the request for review from a team May 18, 2023 15:42
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

can we stick to the set-math metaphor rather than using xor?

@@ -91,11 +92,12 @@ export function createHealthPoller(options: HealthPollerOptions): HealthPoller {
// if xor (symmetric difference) returns values, then elements exist in
// one list and not the other and need to be added to and/or removed from the queue
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (nextList && xorBy(pollQueue, nextList, 'ip').length > 0) {
if (nextList && xorWith(pollQueue, nextList, isEqual).length > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

IMO we should stick to set math or boolean math and not mix and match, so is there a lodash disjunction function or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i don't think lodash has a disjunction function, and considers xor to be its version of symmetric difference. we could do a union of differences instead but that's a bit more cumbersome

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

ok, looks good to me then!

@shlokamin shlokamin merged commit 24f0cd5 into edge May 22, 2023
@shlokamin shlokamin deleted the RCORE-763_update-manual-address-selector branch May 22, 2023 18:51
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