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

Inconsistency records fetched in calendar layout #21539

Closed
franforlizzi opened this issue Feb 23, 2024 · 10 comments · Fixed by #22517 · May be fixed by #22519
Closed

Inconsistency records fetched in calendar layout #21539

franforlizzi opened this issue Feb 23, 2024 · 10 comments · Fixed by #22517 · May be fixed by #22519

Comments

@franforlizzi
Copy link

franforlizzi commented Feb 23, 2024

Describe the Bug

Hi everyone,
I'm using the latest version of Directus
I've completed all Troubleshooting Steps.
There's no other issue that already describes the problem.

Current Behavior:
When viewing a collection using the calendar layout in Directus, the number of records fetched differs from the number of records fetched when using the default table layout.

In the default table layout, Directus fetches all the records from the collection without applying any additional filters.
However, when switching to the calendar layout, Directus fetches only some of the records. This discrepancy occurs because the calendar layout applies a default filter based on the startDateStr from the layout_query of the collection preset. This filter restricts the records to those within a few days before and after that month:

Request Table Layout
Request Table Layout 2
image

Additionally, If I add filters to the collection calendar preset, to extend or override that, Directus makes this request:
Filters
Request Calendar Layout with filters
Of course, this doesn't work.

In this case, the request that counts the items works fine:
Request Count Calendar Layout with filters

Expected Behavior:

I believe the calendar layout should fetch the same number of records as the default table layout, without applying any additional filters by default.
Or, if filters are added to the collection calendar preset, they should be properly applied in conjunction with the default filter based on startDateStr.

To Reproduce

  1. Create a collection
  2. Create items in that collection spanning several months.
  3. View the collection using the calendar layout.
  4. Compare the number of records fetched with the number of records fetched using the default table layout.

Directus Version

v10.9.3

Hosting Strategy

Self-Hosted (Custom)

@franforlizzi
Copy link
Author

Adding visual reference:

Directus calendar bug

@franforlizzi
Copy link
Author

I can confirm this is a bug.
You can reproduce it on your own https://directus.pizza/admin/content/posts?bookmark=45

Directus calendar bug (1)

@rasco
Copy link
Sponsor

rasco commented Mar 8, 2024

Same here and same version

@patriciotourne-eo
Copy link

Can confirm here too. It's quite anoying. Apparently only the first month content loads

@franforlizzi
Copy link
Author

I believe the bug was introduced in v10.8.3 with this fix #20578
In v10.8.2 it works fine.

@JackMullinkosson
Copy link

Can confirm this issue is present on 10.10.4 on Directus cloud

@JoshTheDerf
Copy link
Contributor

Seems like the solution would be to re-fetch the list of displayed records whenever navigating the calendar.

@robinsonjohn
Copy link

robinsonjohn commented May 8, 2024

I can confirm this bug still exists in Directus version 10.11.0.

The calendar view is more or less unusable with this bug, as it never re-fetches items from the API when new dates are navigated.

@Abdallah-Awwad
Copy link

Abdallah-Awwad commented May 23, 2024

Thanks for reporting it – I was experiencing this as well.
Everything's working smoothly in 10.11.1!

@patriciotourne-eo
Copy link

patriciotourne-eo commented May 23, 2024

Works here too! Awesome job 🙌🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
10 participants