mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
feat(02-12.1): stamp a record-context epoch on every session
- add sessions.record_epoch, owned by a BEFORE UPDATE trigger so the ON DELETE SET NULL path and raw SQL writes cannot skip it - normalise pre-existing rows so epoch zero means never switched - project the epoch off the row getSession already loads
This commit is contained in:
1 parent
a08e82d0be
commit
5c9befc0ae
7 files changed
+376
-2
No files matched your search
@@ -100,6 +100,7 @@ const SESSION_OK = {
|
||||
id: "sess-1",
|
||||
expiresAt: new Date(Date.now() + 3_600_000),
|
||||
actingAsUserId: null,
|
||||
recordEpoch: 0,
|
||||
},
|
||||
user: SESSION_USER as never,
|
||||
};
|
||||
|
||||
@@ -81,6 +81,7 @@ function signedIn() {
|
||||
id: "s1",
|
||||
expiresAt: new Date(Date.now() + 1e6),
|
||||
actingAsUserId: null,
|
||||
recordEpoch: 0,
|
||||
},
|
||||
user: { id: "user-1" } as never,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user