fix: add completed/interrupted guard in session upsert (out-of-order event defense)
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 46s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 46s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
22ed18404f
commit
c6f254f864
@ -80,6 +80,11 @@ export class LearningSessionRepository {
|
||||
});
|
||||
|
||||
if (existing) {
|
||||
// Guard: don't update completed/interrupted sessions (defense against out-of-order events)
|
||||
if (existing.status === 'completed' || existing.status === 'interrupted') {
|
||||
return existing;
|
||||
}
|
||||
|
||||
const update: any = {
|
||||
lastEventAt: new Date(Number(data.timestampMs)),
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user