Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

[bug] Pulse Today drops a timed event from every day after the one it starts on

Open schmetti-dev opened this issue 1 week ago • 1 comments

What happened

Pulse Today drops a timed event from every day after the one it starts on. Any timed event that crosses a local midnight (a 23:30 call, a night shift, a flight, a multi-day visit) is listed only on its start day with its full length booked there, and is missing from every later day it runs through, so current is null while it is running; buildAgenda in LIFEOS/PULSE/modules/today.ts; fixed locally with a test

Summary

The class. buildAgenda in LIFEOS/PULSE/modules/today.ts assigns a timed event to exactly one local day, the day it starts on:

.filter((it) => it.start?.dateTime && it.end?.dateTime && localDateKey(new Date(it.start.dateTime), timeZone) === key)

So every timed event that crosses a local midnight is wrong on /today, whatever its length: a 23:30–00:30 call, a night shift, an overnight flight, a hospital stay, a weekend visit, a conference entered with times rather than as all-day. The trigger is "crosses midnight in the principal's time zone", not the duration. All-day events are unaffected (allDay and dayFrames handle them), and the calendar connector is unaffected (its CalDAV time-range and Google timeMin/timeMax queries are overlap-based, so the event does arrive); the agenda builder alone drops it.

What goes wrong, per day.

  • Start day: the event shows, but minutes is its full length, so bookedMinutes and remainingMinutes count hours that belong to other days (a two-day event books 48 h "today").
  • Every later day: the event is absent from events. While it is running, current is null, so the "now" line is empty and next points past it; the day looks free.
  • tomorrow strip: an event that starts today and runs into tomorrow is not on tomorrow's list; one that starts tomorrow and runs on is on tomorrow's list with its full length.

Repro. Any source with a timed event from 23:00 to 01:00 local; GET /api/today?fresh=1 on the second day. agenda.events does not contain it, and on the first day its minutes is 120.

Expected. A timed event is on the agenda of every local day it overlaps, end exclusive (an event ending at 00:00 is not on the next day), with minutes/remainingMinutes counting only the slice inside that day, and start/end labels that say when they lie on another day.

Fix, tested. Filter on overlap with the local day (start < dayEnd && end > dayStart), with local midnight found through Intl in the principal's zone (two passes, so a DST-change day resolves right); clamp minutes and remainingMinutes to the day; label startLabel/endLabel with the short weekday (Fri 16:00) when they lie on another day, plain hh:mm otherwise. today.test.ts covers the spanning day, a middle day, the midnight-exclusive end, the into-tomorrow case, same-day labels, and local midnight across the October DST change; it fails on the current module and passes on the fixed one. Checked against main (LifeOS/install/LIFEOS/PULSE/modules/today.ts, last touched 2026-10-27): the filter line above is unchanged there. Happy to open a PR with the patch and the test.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

schmetti-dev avatar Nov 22 '26 19:11 schmetti-dev

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @schmetti-dev for the report.

This is fixed in our source and goes out in the next release. Pulse Today shows a timed event on every local calendar day it overlaps and counts only that day's portion toward booked time. An overnight event still in progress appears as current after midnight.

Please reopen if it still happens after you upgrade.

danielmiessler avatar Dec 02 '26 09:12 danielmiessler