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

ui: Refactor redux connect for enqueue ranges #45667

Merged
merged 4 commits into from Mar 5, 2020
Merged

ui: Refactor redux connect for enqueue ranges #45667

merged 4 commits into from Mar 5, 2020

Conversation

nathanstilwell
Copy link
Contributor

Moving handleEnqueueRange from Redux connect to a method in the component as the data seems useless in the state and doesn't dispatch an action.

It seems like the GPRC promise wasn't getting handled by either the Thunk or Saga middleware and was confusing Redux as with a Promise instead of an action.

I'm also increasing the request timeout time on the GPRC request to an hour to ensure completion of tasks.

fixes #44948, #42888

Nathan Stilwell added 2 commits March 3, 2020 14:15
Previously, `handleEnqueueRange` was being added to the `mapDispatchToProps`
portion of the call to `connect`. After some refactoring (most likely
due to a redux upgrade, see 7f94c61) this was throwing an error as redux
was expecting a plain object but was recieving a Promise. It's hard to get the
whole story with both Thunk and Saga middleware, but it seems that the GRPC
Promise doesn't fit a signature that any of the middleware can use and so it
goes back to Redux, which rejects it since it is not an action.

Given that none of this data needs to be in the store, and doesn't seem to try
to dispatch any events, I am moving the entire functionality internally to the
component and taking it out of Redux entirely.

Fixes #44948

Release note (admin ui change): refactor redux data flow in enqueue range
See comments on issue #42888

It may not be possible to not have a timeout on this GPRC request, but
in the meantime I'm increasing it to 1 hour to cover any reasonable
case.

Release note (admin ui change): increase enqueue range timeout to an
hour to prevent operation from timing out before completion.
@nathanstilwell nathanstilwell requested a review from a team as a code owner March 3, 2020 20:41
@nathanstilwell nathanstilwell self-assigned this Mar 3, 2020
@cockroach-teamcity
Copy link
Member

This change is Reviewable

`lodash.parseInt` aligns with the ES5 implementation of `parseInt`
which is well suppported (see references).

| references |
| ---------- |
| https://caniuse.com/#feat=mdn-javascript_builtins_parseint |
| https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#Browser_compatibility |

Release note (admin ui change): swapping lodash parseInt for standard parseInt
Copy link
Collaborator

@koorosh koorosh left a comment

Choose a reason for hiding this comment

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

LGTM

Only lint errors have to be fixed. BTW it looks like we need to consider and allow capitalized variable names in tslint configuration

@nathanstilwell
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 5, 2020

Build succeeded

@craig craig bot merged commit e4d0a0e into cockroachdb:master Mar 5, 2020
@nathanstilwell nathanstilwell deleted the enqueue-ranges branch March 5, 2020 21:58
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.

ui: enqueue ranges debug page is broken
3 participants