Closed FoxxMD closed 2 weeks ago
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Yeah I'm working on a fix. The test to reproduce is not exactly right but the issue is the same.
@mcollina PR is opened :) I also added a test for DST -> Standard Time that occurs in March. genNextDay/Hour were already OK for this since the time change is forwards instead of backwards but I went ahead and replaced with date-fns
for genNextHour
so both functions use (and account for) DST quirks the same.
As discovered by @megatwig here in my project the function
genNextDay
adding 24 hours for next day is not sufficient for Daylight Savings Time when a day "has" 25 hours due to clocks being set back.This is causing a log file to be created on every pino
log
statement as the filename does not match what pino-roll expects.To Reproduce
I have modified
utils.test.js
in my branchdstIssue
so that is fails when running on the date of DST.To do this manually in
utils.test.js
line 43 (intest('parseFrequency()' ...
) changeconst today
toand run from the project root with a timezone that would cause DST to occur:
Tested on pino-roll 1.3.0 and 2.1.0