Skip to content

Commit 4137800

Browse files
committed
Notes
1 parent d73a352 commit 4137800

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

notes/2025-12-15_3_invalid-session-cookie-clearing.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ When session cookies were invalid (expired database sessions, corrupted cookies,
1111
## Solution
1212

1313
Modified `getUserId()` in `session.server.ts` to detect when:
14+
1415
1. Session cookies are present in the request (`__session` or `__client-session`)
1516
2. But no valid userId was found in the session
1617

1718
When this condition is detected, we call `logout(request)` which:
19+
1820
- Destroys both session cookies (sets them to expire)
1921
- Redirects to `/`
2022

@@ -32,4 +34,4 @@ if (!userId) {
3234
throw await logout(request);
3335
}
3436
}
35-
```
37+
```

notes/2025-12-17_1_escalation-scheduling-refactor.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,24 @@ AND scheduled_for <= datetime('now')
2323
## Changes
2424

2525
### Migration (`20251217145416_add_scheduled_for.ts`)
26+
2627
- Added `scheduled_for` text column
2728
- Backfills existing pending escalations based on current vote count
2829

2930
### Model (`escalationVotes.server.ts`)
31+
3032
- `calculateScheduledFor(createdAt, voteCount)` - computes scheduled time
3133
- `updateScheduledFor(id, scheduledFor)` - persists new scheduled time
3234
- `getDueEscalations()` - queries escalations past their scheduled time
3335
- `createEscalation()` - now sets initial `scheduled_for` (36h from creation)
3436

3537
### Handlers (`handlers.ts`)
38+
3639
- Vote handler: updates `scheduled_for` after recording vote
3740
- Re-escalation handler: updates `scheduled_for` when upgrading to majority voting
3841

3942
### Resolver (`escalationResolver.ts`)
43+
4044
- Simplified to use `getDueEscalations()` instead of `getPendingEscalations()`
4145
- Removed `shouldAutoResolve()` check—query already filters for due escalations
4246

0 commit comments

Comments
 (0)