Skip to content

[BUG] For csv report, if choose "Today" for time range, it fails to generate report #88

@zhongnansu

Description

@zhongnansu

Describe the bug
In Discover, if choose "Today" for time range, csv report couldn't generate. The request will not even be successfully sent to backend for execution.

  • Error log in browser

    context_menu_helpers.js:47 Uncaught TypeError: Cannot read property 'diff' of undefined
        at getTimeFieldsFromUrl (context_menu_helpers.js:47)
        at HTMLButtonElement.<anonymous> (context_menu.js:163)
        at HTMLDocument.dispatch (jquery.js:5429)
        at HTMLDocument.elemData.handle (jquery.js:5233)
    
  • Root Cause
    If set to "Today", we fail to get time range from url, becuase in the time field of url, it will be

    ....time:(from:now%2Fd,to:now%2Fd))...
    
  • Comparing to for example "Last 24 hours"

    time:(from:now-24h,to:now)
    

The logic actually converting start and end time to absolute data and time, then calculate the math diff and use as timeduration in ISO format. But for Today case, the converted time range will be same for start and end.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions