reviews and inbox smashing

This commit is contained in:
Ian Gulliver
2026-10-16 13:56:46 -07:00
parent 8f873788d7
commit a0e6a3953f
15 changed files with 178 additions and 241 deletions
-15
View File
@@ -156,21 +156,6 @@ func emitReview(ctx context.Context, tx *sql.Tx, emit emitFunc, kind, id, actor
return emit(api.Event{Kind: kind, ProjectId: &projectID, TaskId: &r.TaskId, Actor: actor, Payload: ToPayload(r)})
}
func questionReviews(ctx context.Context, q querier, item api.InboxItem) ([]api.Review, error) {
if item.Kind != api.Question {
return []api.Review{}, nil
}
rows, err := q.QueryContext(ctx, `
SELECT `+reviewColumns+` FROM reviews WHERE task_id = ? AND snapshot_n = (
SELECT min(n) FROM snapshots WHERE task_id = ? AND created_at >= ?
)
`, item.TaskId, item.TaskId, formatTime(item.CreatedAt))
if err != nil {
return nil, err
}
return scanReviews(rows)
}
func scanReviews(rows *sql.Rows) ([]api.Review, error) {
defer rows.Close()