At the moment if you are doing stuff until dayroll hits, mafia detects dayroll is ongoing and will kick you back to login screen, but when doing so it will try to run your logout script which itself throws errors about currently being during dayroll.
So, if you are doing stuff and rollover hits, when you issue a request, KoL redirects to maint.php. That is the definition of what describe as "being during dayroll". (A word I had never heard, before you used it in this thread.)
.
You say that KoLmafia then runs the logout script? That is a KoLmafia bug; if KoLmafia detects that rollover is in progress, it should give you the login window and not run the logout script.
Which has literally nothing to do with the issue you initially reported, where you said that 30 minutes after rollover, you tried to issue a request and KoLmafia timed you in, as it does any time a request redirects to login.php - not maint.php. Therefore, you are not "during dayroll". You are "after dayroll". And the ONLY way we can distinguish that case, as opposed to any other timein, is to log you in, call api.php, and notice that the next rollover time is a day later than it was last time we looked it it.
I was assuming that this would be resolved by automatically kicking you back out to the login window if "dayroll already passed" you so that you can log back in formally and it can do all the needed "dayroll" things.
Which is to say, you are assuming that KoLmafia will log you in and detect it is the next day (i.e. "dayroll has already passed") and then, somehow, log you out and send you to the login window, so that you can then log in again.
I think that if a request redirects to maint.php, we should send you to the login window without running the logout script.
I think that if a request redirects you to login.php, we should time you in, and if we detect that "dayroll has passed", reset all the counters and such as if you had logged in to a new day, and then let you carry on from there.
I'd be happy with mafia performing no actions and simply kicking us back to the login window if it detected that rollover had passed. Would save me the trouble of closing the window and then restarting (which I do presently rather than simply "exit"ing, due to not wanting my logout script to run and inevitably have errors, as taltamir mentioned).
In other words, you want it to time you in and then immediately log you out (sans logout script) and kick you back to the login window if it detects a new day has passed.
I still have not heard about exactly what errors you get in a logout script which are not due to the properties not resetting correctly. If I time you in and reset properties for a new day - if you are on a new day - what is your logout script expecting that would make that work differently than logging you in via the login window (rather than timein) ad resetting properties?
Is the issue, literally, only that the logout script depends on the current values of properties being correct - rather than yesterday's values? Which is, specifically, the issue that my approach is attempting to solve with a single login, rather than forcing a login/logout/login, which both of you seem to want?