R2: harness payload fixes found by the smoke pass
- display-name marker: letters-only 'Zzloadtest' (the editable-name validator forbids digits/colons), so profile.update resends the seeded name successfully. - draft.save: rack_order is a string in the backend draft DTO (was sent as []), fixing the bad_request. Both confirmed ok against the contour. chat_not_your_turn / nudge_own_turn are by-design turn gates (backend/internal/social/chat.go), correctly exercised.
This commit is contained in:
@@ -201,7 +201,9 @@ func (d *Driver) secondaryOp(ctx context.Context, p seed.Account, g *Game, rng *
|
||||
c, _ := d.edge.CheckWord(ctx, p.Token, g.ID, []byte{0, 1, 2})
|
||||
d.rec.Record("game.check_word", c, time.Since(t0))
|
||||
case 3:
|
||||
c, _ := d.edge.DraftSave(ctx, p.Token, g.ID, `{"rack_order":[],"board_tiles":[]}`)
|
||||
// rack_order is an opaque string and board_tiles a (here empty) array, per the
|
||||
// backend draft DTO; a malformed shape is rejected as bad_request.
|
||||
c, _ := d.edge.DraftSave(ctx, p.Token, g.ID, `{"rack_order":"","board_tiles":[]}`)
|
||||
d.rec.Record("draft.save", c, time.Since(t0))
|
||||
case 4:
|
||||
c, _ := d.edge.DraftGet(ctx, p.Token, g.ID)
|
||||
|
||||
@@ -10,8 +10,10 @@ import (
|
||||
)
|
||||
|
||||
// Marker prefixes every display_name the harness writes. Cleanup matches on it, so
|
||||
// the harness only ever deletes its own rows and never touches real accounts.
|
||||
const Marker = "lt:"
|
||||
// the harness only ever deletes its own rows and never touches real accounts. It is
|
||||
// a distinctive, letters-only string so a profile.update can resend the seeded name
|
||||
// through the editable-display-name validator (which forbids digits and colons).
|
||||
const Marker = "Zzloadtest"
|
||||
|
||||
// Schema-qualified targets so the seeder does not depend on the connection's
|
||||
// search_path (the backend pins search_path=backend; we qualify explicitly).
|
||||
@@ -100,7 +102,9 @@ func (s *Seeder) Seed(ctx context.Context, nDurable, nGuest int) (*Pool, error)
|
||||
if guest {
|
||||
kind = "g"
|
||||
}
|
||||
name := fmt.Sprintf("%s%s-%06d", Marker, kind, i)
|
||||
// A letters-only display name (Marker + kind), valid per the editable-name
|
||||
// validator; account_id, not the name, is the unique key, so duplicates are fine.
|
||||
name := Marker + kind
|
||||
acctRows = append(acctRows, []any{aid, name, guest, lang})
|
||||
sessRows = append(sessRows, []any{sid, aid, hash, "active"})
|
||||
if !guest {
|
||||
|
||||
Reference in New Issue
Block a user