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

[EuiSuperDatePicker] Error occurs when changing absolute date #3746

Closed
cnasikas opened this issue Jul 15, 2020 · 5 comments · Fixed by #3750
Closed

[EuiSuperDatePicker] Error occurs when changing absolute date #3746

cnasikas opened this issue Jul 15, 2020 · 5 comments · Fixed by #3750
Assignees
Labels

Comments

@cnasikas
Copy link
Member

@stephmilovic found the following bug when reviewing elastic/kibana#70713. The bug is on master and had nothing to do with the PR.

Steps to reproduce the bug:

  1. Open the date picker
  2. Click Absolute
  3. Select a date
  4. Edit the time

The bug appears randomly and is not always reproducible.

87477416-5146d280-c5e5-11ea-947b-a5152033582d

@cnasikas cnasikas self-assigned this Jul 15, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@cnasikas cnasikas changed the title [SIEM] Datepicker bug when changing date [EUI] Datepicker bug when changing date Jul 15, 2020
@cchaos cchaos changed the title [EUI] Datepicker bug when changing date [Date Filter] Error occurs when changing absolute date Jul 15, 2020
@cchaos cchaos changed the title [Date Filter] Error occurs when changing absolute date [Timepicker] Error occurs when changing absolute date Jul 15, 2020
@cchaos
Copy link
Contributor

cchaos commented Jul 15, 2020

Can't reproduce this in EUI, but have been told it is flakey and doesn't always error. @elastic/kibana-app-arch team, please investigate. If you do find it's an issue in EuiSuperDatePicker, please move this issue to EUI.

@lizozom
Copy link
Contributor

lizozom commented Jul 15, 2020

(a) This is an EUI bug. I suspect that when you edit the absolute date manually, for a brief moment you have an invalid date and then the function data.format fails.
(b) I also noticed that when I switch to an absolute date, my CPU usage would jump and if my debugger is open, it would often get stuck. Tried this multiple times. Same result. I would check how often the field is being validated (debounce or even validate on blur)

The steps I took to reproduce were

  1. Open discover
  2. Change the date to absolute
  3. Pick a date and a time
  4. Edit the string field in the bottom

Doing that, I got both a React error and the can't call method format of undefined (that can be seen in the gif).

When I opened the debugger and put a conditional break-point in the function formatDate (date == undefined), and repeated the same action, the browser would just hang. I repeated the same flow 3 or 4 time with similar results.

This makes me suspect that the field is being validated very often and that adding a conditional break-point to it made it slower (but I'm obviously not sure).

@lizozom lizozom transferred this issue from elastic/kibana Jul 15, 2020
@cnasikas cnasikas removed their assignment Jul 15, 2020
@cchaos cchaos changed the title [Timepicker] Error occurs when changing absolute date [EuiSuperDatePicker] Error occurs when changing absolute date Jul 15, 2020
@thompsongl
Copy link
Contributor

I was able to reproduce with a simple EUI case. Investigating further.

@thompsongl thompsongl self-assigned this Jul 15, 2020
@thompsongl
Copy link
Contributor

I've tracked down the problem, but am running into some unrelated build side effects from the packaged library. I'll sort it out before opening a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants