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

Insights module bugs #8701

Closed
3 tasks done
Attacler opened this issue Oct 11, 2021 · 10 comments
Closed
3 tasks done

Insights module bugs #8701

Attacler opened this issue Oct 11, 2021 · 10 comments

Comments

@Attacler
Copy link

Attacler commented Oct 11, 2021

Preflight Checklist

Describe the Bug

First of all, i know its a beta but here are some things i found:

  • Filter on date empty gives an error in the network tab:

    {"errors":[{"message":"\"_null\" has to be a boolean","extensions":{"code":"INVALID_QUERY"}}]}

    The query it is trying to execute:

    {"_and":[{"betaald_op":{"_null":null}}]}
  • Sometimes date does not go well

    image

    The settings i have selected:

    image

    Fields:

    • uren = float
    • registratiedatum = date

So far it looks like a great feature!

To Reproduce

See above

What version of Directus are you using?

docker rc96

What version of Node.js are you using?

docker

What database are you using?

Postgres 13

What browser are you using?

Chrome

What operating system are you using?

Windows

How are you deploying Directus?

Docker

@azrikahar azrikahar changed the title Insights buggs Insights module bugs Oct 12, 2021
@azrikahar
Copy link
Contributor

  • Filter on date empty gives an error in the network tab

This should be fixed by #8696 👍

  • Sometimes date does not go well

Hmm I can't seem to reproduce this on rc.96. I've also ensured to use Date field 🤔 Would you mind checking the following of what I did and let me know are there any discrepancy:

jkL0VxnoaI.mp4

@Attacler
Copy link
Author

@azrikahar I restarted the directus instance and it seems to work like meant to be.
Not sure if there is any (browser/server) cache or anything else involved.

@azrikahar
Copy link
Contributor

I restarted the directus instance and it seems to work like meant to be.
Not sure if there is any (browser/server) cache or anything else involved.

That's... strange indeed. I also did another test by enabling cache, but nothing seems to be out of the ordinary. However it might be somehow a weirdly formed cached data. (or maybe caused by the bug with filter 🤔)

Since the first bug will be addressed by another PR, and this second date bug "seemingly" disappeared, I'll close this issue for now. Do let us know if it ever appear again so we can reopen this 👍

@joselcvarela
Copy link
Member

joselcvarela commented Oct 12, 2021

Hello @Attacler , @azrikahar
I am not sure of this but, my best guess is the results are not being sorted in any way, so some databases could not return the results in proper order.

Since it's not reproducible it's a bit hard to tell if can be fixed or not.
So let's wait for the PR @azrikahar mentioned, play a little more and reopen if happens again.

@Attacler
Copy link
Author

@azrikahar i have found it again.
It basicly happends if you go over 1 month of data (still on rc96)

@azrikahar
Copy link
Contributor

azrikahar commented Nov 5, 2021

@Attacler Pardon the delay on getting back on this 🙈 However I've just recently been able to reproduce this here, which seems to align with your suspicion of "going over 1 month of data":

chrome_D6ras2qDuM

Oddly enough changing this from datetime to numeric (Reference)

seems to fix it:

chrome_O4lpsSZNTX

We'll need to investigate further whether this is an issue of Directus' current implementation of ApexCharts.js, or an actual bug with ApexCharts.js itself.

@Attacler
Copy link
Author

Attacler commented Nov 5, 2021

@azrikahar thank you for getting back on it.
I think that it could be solved with making it a string and making the date a string (date.toLocaleDateString).
Not sure if this is the solution tho, just a idea that went trough my head while reading this.

@azrikahar
Copy link
Contributor

azrikahar commented Nov 5, 2021

That is indeed one of the possibility I thought of as well, but it'd also probably better if we can still leverage on the provided datetime type. I think I was able to reproduce it on someone else's codepen (very slightly break, but still looked fine, unlike ours), but I didn't note down what it was & I closed the incognito tab earlier 😂

Currently I'm hoping to reproduce this in something like codepen or jsfiddle so we can be extra sure if it's a bug with the chart library 👍 Will try to look into it.

@azrikahar
Copy link
Contributor

It's been a while but as I've once again unintentionally reproduced this, this is starting to be suspected as an issue with the API returned value rather than an issue with the chart rendering.

Also managed to reproduce it by using the API data in minimal setup: https://jsitor.com/preview/hlF6fQJni

@Attacler do you by any chance still have a reproducible/existing chart like this? It's okay if you don't have it anymore, but in case you do have it, would you mind providing the returned payload via the API? Here's an example of how to do that from what I could think of:

OiqqLQx49v.mp4
  1. Open devtools so it will track network requests

  2. View the dashboard with the faulty dashboard

  3. check network tabs in Devtools, and find the API call that corresponds to the faulty chart's data (might be difficult if you have multiple charts)

  4. Copy the data returned via the step shown in the clip above and share it here

  5. It'd also be helpful if you can share the query that the API call used, which can be viewed in the Payload tab of the same network request:

    image

@rijkvanzanten
Copy link
Member

I'm not able to reproduce this under v9.9.0. @azrikahar / @Attacler could you confirm if the issue still persists on your end? We can reopen accordingly 🙂 Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants