Ambiguous consult only redirects on low confidence, and the testing template greets the signed-in user instead of a hardcoded name. Session tokens no longer parse as user id 0. Live chat sessions now evict the oldest entry at a hard cap. Co-authored-by: Cursor <cursoragent@cursor.com>
19 lines
450 B
Go
19 lines
450 B
Go
package coordinator
|
|
|
|
import "testing"
|
|
|
|
func TestParseDecimalIDRejectsSessionTokens(t *testing.T) {
|
|
if got := parseDecimalID("u_sess_12"); got != 0 {
|
|
t.Fatalf("session token parsed as %d", got)
|
|
}
|
|
if got := parseDecimalID("108abc"); got != 0 {
|
|
t.Fatalf("partial decimal parsed as %d", got)
|
|
}
|
|
if got := parseDecimalID("108"); got != 108 {
|
|
t.Fatalf("got %d", got)
|
|
}
|
|
if got := parseDecimalID(" 0 "); got != 0 {
|
|
t.Fatalf("got %d", got)
|
|
}
|
|
}
|