Files
rzuastiandClaude Sonnet 4.6 e1287e5a0f Use server-side date filtering for device event history chart
The device event history chart previously fetched all events and filtered
client-side. This wires the existing created_from API parameter to the
frontend so filtering happens in the backend.

Also fixes a bug where the Today filter returned no results: rusqlite was
storing datetimes with a space separator ("YYYY-MM-DD HH:MM:SS+00:00")
while SQL filters used RFC 3339 with a T separator, causing string
comparisons to fail for same-day events. All datetime storage across
device_events, devices, and notifications is now consistently RFC 3339.
A migration converts existing records.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:51:19 -04:00

7 lines
1.2 KiB
SQL

INSERT INTO NOTIFICATIONS (id, created_on, notification_type, title, body, is_new) VALUES (1, '2026-01-03T14:13:12+00:00', 'NewDeviceFound', 'Unread new device found', 'Body unread new device found', 1);
INSERT INTO NOTIFICATIONS (id, created_on, notification_type, title, body, is_new) VALUES (2, '2026-01-04T08:10:13+00:00', 'NewDeviceFound', 'Read new device found', 'Body read new device found', 0);
INSERT INTO NOTIFICATIONS (id, created_on, notification_type, title, body, is_new) VALUES (3, '2026-01-05T17:20:01+00:00', 'DeviceOnlineAfterTime', 'Unread device online after time', 'Body unread device online after time', 1);
INSERT INTO NOTIFICATIONS (id, created_on, notification_type, title, body, is_new) VALUES (4, '2026-01-06T02:11:12+00:00', 'DeviceOnlineAfterTime', 'Read device online after time', 'Body read device online after time', 0);
INSERT INTO NOTIFICATIONS (id, created_on, notification_type, title, body, is_new) VALUES (5, '2026-02-01T11:11:11+00:00', 'Other', 'Unread other', 'Body other', 1);
INSERT INTO NOTIFICATIONS (id, created_on, notification_type, title, body, is_new) VALUES (6, '2026-02-03T13:13:13+00:00', 'Other', 'Read other', 'Body other', 0);