fix(analytics): query latest 7 days #466

Closed
opened 2026-04-05 17:11:33 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @depado on 12/18/2025

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Possible fix for default analytics endpoint not returning the correct data as shown in #2113

.optional() being placed before .prefault() in the Zod schema is causing it to short-circuit and return undefined instead of applying default values (or at least that's my understanding if it)

I'm not sure this fix actually solves the issue and I don't have enough data locally to test this. Feel free to discard my pull request if I went in the wrong direction or request changes if needed.
Also this issue might be present in other files but I focused on the analytics one, let me know if you want me to fix the other files in the same PR.

Also thanks for the great product!

fixes #2113

*Originally created by @depado on 12/18/2025* ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description Possible fix for default analytics endpoint not returning the correct data as shown in #2113 `.optional()` being placed before `.prefault()` in the Zod schema is causing it to short-circuit and return `undefined` instead of applying default values (or at least that's my understanding if it) I'm not sure this fix actually solves the issue and I don't have enough data locally to test this. Feel free to discard my pull request if I went in the wrong direction or request changes if needed. Also this issue might be present in other files but I focused on the analytics one, let me know if you want me to fix the other files in the same PR. Also thanks for the great product! fixes #2113
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#466