kolibri
kolibri copied to clipboard
Facility > Data: Generate log does nothing when clicked before the first log date loads
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Target branch: develop
Observed behavior
- In Facility > Data, clicking Generate log (session or summary logs) before the
firstlogdateresponse arrives raises aTypeError. The date-range dialog does not open. - The dialog stays closed after the response arrives, and clicking Generate log again does nothing. Reloading the page restores the button.
- The page requests
firstlogdateonly after the facility list returns, so both requests have to finish before the button works. - #15825 resets the date when the facility id in the URL changes while the page is open; the button fails the same way until the new facility's date arrives.
Errors and logs
Browser console:
TypeError: Cannot read properties of null (reading 'getDate')
at VueComponent.firstAllowedDate (kolibri/plugins/facility/frontend/views/DataPage/index.vue:283)
Raised by firstAllowedDate, which reads firstLogDate while it is still null.
Steps to reproduce
- In the browser's network tools, throttle to Slow 3G.
- As a facility admin, open Facility > Data.
- Click Generate log under Session logs as soon as the page renders.
- Wait for the
firstlogdaterequest to finish, then click Generate log again.
Context
- Kolibri
developat 758605b764. - Reproduced in a Jest render of
DataPagewith thefirstlogdateresponse held.
Acceptance Criteria
- [ ] Clicking either Generate log before the
firstlogdateresponse arrives logs noTypeError. - [ ] Once the response has arrived, clicking either Generate log opens the date-range dialog, whether or not it was clicked earlier.
- [ ] Both hold after the facility changes while the page stays open.
- [ ] A Jest spec holds the
firstlogdateresponse, clicks Generate log, releases the response, and checks both.
AI usage
Claude Code found this while working on #13260, reproduced it in a Jest render of DataPage, and drafted this issue.