Add character levels and permanent player titles
This commit is contained in:
@@ -64,6 +64,7 @@ func (d *DB) migrate(ctx context.Context) error {
|
||||
}
|
||||
for _, stmt := range []string{
|
||||
`CREATE TABLE IF NOT EXISTS schema_migrations(version INTEGER PRIMARY KEY)`,
|
||||
`CREATE TABLE IF NOT EXISTS title_awards(account_id TEXT NOT NULL, title_id TEXT NOT NULL, scope TEXT NOT NULL, scope_key TEXT NOT NULL, character_id TEXT NOT NULL, award TEXT NOT NULL, PRIMARY KEY(account_id,title_id), UNIQUE(scope,scope_key,title_id))`,
|
||||
`CREATE TABLE IF NOT EXISTS character_records(character_id TEXT PRIMARY KEY, account_id TEXT NOT NULL, world_id TEXT NOT NULL, name TEXT NOT NULL, state TEXT NOT NULL, character TEXT NOT NULL)`,
|
||||
`CREATE UNIQUE INDEX IF NOT EXISTS one_living_character ON character_records(account_id) WHERE state IN ('alive','eligible')`,
|
||||
`CREATE INDEX IF NOT EXISTS characters_world ON character_records(world_id)`,
|
||||
|
||||
@@ -135,6 +135,8 @@ func (l *Lease) Save(ctx context.Context, w *game.World, claimID string) error {
|
||||
return l.SaveCommand(ctx, w, claimID, nil, "")
|
||||
}
|
||||
func (l *Lease) SaveCommand(ctx context.Context, w *game.World, claimID string, command *Command, outcome string) error {
|
||||
live := w
|
||||
w = stageTitleWorld(w)
|
||||
data, err := json.Marshal(w)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -167,20 +169,26 @@ func (l *Lease) SaveCommand(ctx context.Context, w *game.World, claimID string,
|
||||
return errors.New("passage already redeemed or unavailable")
|
||||
}
|
||||
}
|
||||
if w.Phase == "won" {
|
||||
for _, c := range w.Characters {
|
||||
if c.View.Entity.State != "eligible" {
|
||||
continue
|
||||
}
|
||||
encoded, err := json.Marshal(c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = tx.ExecContext(ctx, d.q(`INSERT INTO passages(character_id,account_id,source_world,character) VALUES(?,?,?,?) ON CONFLICT(character_id) DO UPDATE SET source_world=excluded.source_world,character=excluded.character,claimed_world=NULL WHERE passages.claimed_world=excluded.source_world`), c.View.Entity.ID, c.Account, w.ID, string(encoded))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err = d.syncPassages(ctx, tx, w); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = d.syncCharacters(ctx, tx, w, claimID); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = d.syncTitles(ctx, tx, w); err != nil {
|
||||
return err
|
||||
}
|
||||
// Rewrite the final payloads after the immutable award claims have resolved.
|
||||
// The transaction already holds the owner, passage and character row locks.
|
||||
data, err = json.Marshal(w)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err = tx.ExecContext(ctx, d.q(`UPDATE worlds SET snapshot=? WHERE id=? AND owner=?`), string(data), l.WorldID, l.Owner); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = d.syncPassages(ctx, tx, w); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = d.syncCharacters(ctx, tx, w, claimID); err != nil {
|
||||
return err
|
||||
@@ -208,7 +216,11 @@ func (l *Lease) SaveCommand(ctx context.Context, w *game.World, claimID string,
|
||||
return err
|
||||
}
|
||||
l.Revision++
|
||||
w.Saved()
|
||||
for id, c := range w.Characters {
|
||||
live.Characters[id].View.Titles = c.View.Titles
|
||||
}
|
||||
live.PendingTitles = nil
|
||||
live.Saved()
|
||||
return nil
|
||||
}
|
||||
func (l *Lease) Release(ctx context.Context) error {
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"sort"
|
||||
|
||||
"aeternalis/server/internal/game"
|
||||
p "aeternalis/server/internal/protocol"
|
||||
)
|
||||
|
||||
// Only title slices change in this staged view. The live simulation is untouched
|
||||
// until its snapshot, claim ledger, character records and passages all commit.
|
||||
func stageTitleWorld(w *game.World) *game.World {
|
||||
staged := *w
|
||||
staged.Characters = make(map[string]*game.Character, len(w.Characters))
|
||||
for id, c := range w.Characters {
|
||||
copy := *c
|
||||
copy.View.Titles = append([]p.TitleAward{}, c.View.Titles...)
|
||||
staged.Characters[id] = ©
|
||||
}
|
||||
return &staged
|
||||
}
|
||||
|
||||
func (d *DB) syncTitles(ctx context.Context, tx *sql.Tx, w *game.World) error {
|
||||
// syncCharacters has already locked these rows. A stale source world may
|
||||
// checkpoint itself, but it cannot grant titles for a transferred character.
|
||||
owned := make(map[string]bool, len(w.Characters))
|
||||
for id, c := range w.Characters {
|
||||
var account, world string
|
||||
err := tx.QueryRowContext(ctx, d.q(`SELECT account_id,world_id FROM character_records WHERE character_id=?`), id).Scan(&account, &world)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
owned[id] = account == c.Account && world == w.ID
|
||||
}
|
||||
candidates := append([]game.TitleCandidate{}, w.PendingTitles...)
|
||||
// All owners lock title IDs in the same order, even with different catalogs.
|
||||
// Stable ordering preserves simulation event order for contenders for one ID.
|
||||
sort.SliceStable(candidates, func(i, j int) bool { return candidates[i].Award.ID < candidates[j].Award.ID })
|
||||
granted := map[string]map[string]bool{}
|
||||
for _, candidate := range candidates {
|
||||
c := w.Characters[candidate.CharacterID]
|
||||
if c == nil || !owned[candidate.CharacterID] {
|
||||
continue
|
||||
}
|
||||
award := candidate.Award
|
||||
if award.ID == "" || award.WorldID != w.ID {
|
||||
return errors.New("invalid title candidate identity")
|
||||
}
|
||||
key := ""
|
||||
switch award.Scope {
|
||||
case "personal":
|
||||
key = c.Account
|
||||
case "world":
|
||||
key = w.ID
|
||||
case "global":
|
||||
key = "global"
|
||||
default:
|
||||
return errors.New("invalid title candidate scope")
|
||||
}
|
||||
raw, err := json.Marshal(award)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
result, err := tx.ExecContext(ctx, d.q(`INSERT INTO title_awards(account_id,title_id,scope,scope_key,character_id,award) VALUES(?,?,?,?,?,?) ON CONFLICT DO NOTHING`), c.Account, award.ID, award.Scope, key, candidate.CharacterID, string(raw))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
count, err := result.RowsAffected()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if count == 1 {
|
||||
if granted[candidate.CharacterID] == nil {
|
||||
granted[candidate.CharacterID] = map[string]bool{}
|
||||
}
|
||||
granted[candidate.CharacterID][award.ID] = true
|
||||
}
|
||||
}
|
||||
byAccount := map[string][]p.TitleAward{}
|
||||
for id, c := range w.Characters {
|
||||
if !owned[id] {
|
||||
continue
|
||||
}
|
||||
awards, loaded := byAccount[c.Account]
|
||||
if !loaded {
|
||||
var err error
|
||||
awards, err = d.accountTitles(ctx, tx, c.Account)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
byAccount[c.Account] = awards
|
||||
}
|
||||
if c.View.Entity.State != "dead" {
|
||||
c.View.Titles = append([]p.TitleAward{}, awards...)
|
||||
continue
|
||||
}
|
||||
// A historical dead life keeps its own record. Only awards from its death
|
||||
// transaction are appended; titles from later lives do not rewrite history.
|
||||
keep := map[string]bool{}
|
||||
for _, award := range c.View.Titles {
|
||||
keep[award.ID] = true
|
||||
}
|
||||
for title := range granted[id] {
|
||||
keep[title] = true
|
||||
}
|
||||
c.View.Titles = []p.TitleAward{}
|
||||
for _, award := range awards {
|
||||
if keep[award.ID] {
|
||||
c.View.Titles = append(c.View.Titles, award)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *DB) accountTitles(ctx context.Context, tx *sql.Tx, account string) ([]p.TitleAward, error) {
|
||||
rows, err := tx.QueryContext(ctx, d.q(`SELECT award FROM title_awards WHERE account_id=? ORDER BY title_id`), account)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
awards := []p.TitleAward{}
|
||||
for rows.Next() {
|
||||
var raw string
|
||||
var award p.TitleAward
|
||||
if err = rows.Scan(&raw); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err = json.Unmarshal([]byte(raw), &award); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
awards = append(awards, award)
|
||||
}
|
||||
return awards, rows.Err()
|
||||
}
|
||||
|
||||
func (d *DB) syncPassages(ctx context.Context, tx *sql.Tx, w *game.World) error {
|
||||
if w.Phase != "won" {
|
||||
return nil
|
||||
}
|
||||
// Stable row order also prevents competing owners from acquiring survivor
|
||||
// passage locks in opposite map iteration order.
|
||||
ids := make([]string, 0, len(w.Characters))
|
||||
for id := range w.Characters {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
sort.Strings(ids)
|
||||
for _, id := range ids {
|
||||
c := w.Characters[id]
|
||||
if c.View.Entity.State != "eligible" {
|
||||
continue
|
||||
}
|
||||
encoded, err := json.Marshal(c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = tx.ExecContext(ctx, d.q(`INSERT INTO passages(character_id,account_id,source_world,character) VALUES(?,?,?,?) ON CONFLICT(character_id) DO UPDATE SET source_world=excluded.source_world,character=excluded.character,claimed_world=NULL WHERE passages.claimed_world=excluded.source_world OR (passages.source_world=excluded.source_world AND passages.claimed_world IS NULL)`), c.View.Entity.ID, c.Account, w.ID, string(encoded))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"aeternalis/server/content"
|
||||
"aeternalis/server/internal/game"
|
||||
p "aeternalis/server/internal/protocol"
|
||||
)
|
||||
|
||||
func titleCandidate(w *game.World, c *game.Character, id, scope string) game.TitleCandidate {
|
||||
return game.TitleCandidate{CharacterID: c.View.Entity.ID, Award: p.TitleAward{ID: id, Name: id, Description: "A permanent test title", Scope: scope, WorldID: w.ID, EarnedAt: time.Now().UTC().Format(time.RFC3339Nano), Effects: p.TitleEffects{Damage: 2, MoveSpeed: -.5}}}
|
||||
}
|
||||
|
||||
func TestTitlePersistence(t *testing.T) {
|
||||
runTitleTests(t, "file:"+filepath.ToSlash(filepath.Join(t.TempDir(), "titles.db")))
|
||||
}
|
||||
func TestPostgresTitlePersistence(t *testing.T) {
|
||||
dsn := os.Getenv("TEST_DATABASE_URL")
|
||||
if dsn == "" {
|
||||
t.Skip("TEST_DATABASE_URL not configured")
|
||||
}
|
||||
runTitleTests(t, dsn)
|
||||
}
|
||||
func runTitleTests(t *testing.T, dsn string) {
|
||||
ctx := context.Background()
|
||||
db, err := Open(ctx, dsn)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer db.Close()
|
||||
b, err := content.Load()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
prefix := game.ID()
|
||||
makeWorld := func(suffix string) (*game.World, *Lease, *game.Character) {
|
||||
t.Helper()
|
||||
w := game.New(prefix+suffix, 1, time.Now().UTC(), b)
|
||||
l, _, err := db.Acquire(ctx, w)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Cleanup(func() { _ = l.Release(ctx) })
|
||||
c, err := w.Join(prefix+suffix, "Traveler")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return w, l, c
|
||||
}
|
||||
count := func(id string) int {
|
||||
t.Helper()
|
||||
var n int
|
||||
if err := db.sql.QueryRowContext(ctx, db.q(`SELECT count(*) FROM title_awards WHERE title_id=?`), id).Scan(&n); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return n
|
||||
}
|
||||
has := func(c *game.Character, id string) bool {
|
||||
for _, a := range c.View.Titles {
|
||||
if a.ID == id {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
t.Run("permanent inheritance and immutable history", func(t *testing.T) {
|
||||
w, l, c := makeWorld("-life")
|
||||
id := prefix + "-personal"
|
||||
w.PendingTitles = []game.TitleCandidate{titleCandidate(w, c, id, "personal")}
|
||||
if err := l.Save(ctx, w, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
original := c.View.Titles[0]
|
||||
if count(id) != 1 || len(w.PendingTitles) != 0 {
|
||||
t.Fatal("award not committed")
|
||||
}
|
||||
c.View.Titles[0].Name = "Changed"
|
||||
c.View.Titles[0].Effects.Damage = 999
|
||||
w.PendingTitles = []game.TitleCandidate{titleCandidate(w, c, id, "personal")}
|
||||
if err := l.Save(ctx, w, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if count(id) != 1 || !reflect.DeepEqual(c.View.Titles, []p.TitleAward{original}) {
|
||||
t.Fatal("retry changed immutable title")
|
||||
}
|
||||
if err := w.Control("retire", c.View.Entity.ID, "", "test"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := l.Save(ctx, w, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
next, err := w.Join(c.Account, "Replacement")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := l.Save(ctx, w, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !has(next, id) || !has(c, id) || next.View.Level != 1 || c.View.Entity.State != "dead" {
|
||||
t.Fatal("death lost title or resurrected life")
|
||||
}
|
||||
later := prefix + "-later"
|
||||
w.PendingTitles = []game.TitleCandidate{titleCandidate(w, next, later, "personal")}
|
||||
if err := l.Save(ctx, w, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if has(c, later) || !has(next, later) {
|
||||
t.Fatal("later life rewrote dead history")
|
||||
}
|
||||
if err := l.Release(ctx); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
restoredLease, raw, err := db.Acquire(ctx, w)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer restoredLease.Release(ctx)
|
||||
var restored game.World
|
||||
if err = json.Unmarshal(raw, &restored); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err = restored.Restore(time.Now()); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !has(restored.Characters[next.View.Entity.ID], id) || restored.Characters[c.View.Entity.ID].View.Entity.State != "dead" {
|
||||
t.Fatal("restart lost titles or death")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("global race and independent world firsts", func(t *testing.T) {
|
||||
a, la, ca := makeWorld("-race-a")
|
||||
z, lz, cz := makeWorld("-race-z")
|
||||
global, world := prefix+"-global", prefix+"-world"
|
||||
a.PendingTitles = []game.TitleCandidate{titleCandidate(a, ca, world, "world"), titleCandidate(a, ca, global, "global")}
|
||||
z.PendingTitles = []game.TitleCandidate{titleCandidate(z, cz, global, "global"), titleCandidate(z, cz, world, "world")}
|
||||
var wg sync.WaitGroup
|
||||
results := make(chan error, 2)
|
||||
for _, pair := range []struct {
|
||||
w *game.World
|
||||
l *Lease
|
||||
}{{a, la}, {z, lz}} {
|
||||
wg.Add(1)
|
||||
go func(w *game.World, l *Lease) { defer wg.Done(); results <- l.Save(ctx, w, "") }(pair.w, pair.l)
|
||||
}
|
||||
wg.Wait()
|
||||
close(results)
|
||||
for err := range results {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
winners := 0
|
||||
for _, c := range []*game.Character{ca, cz} {
|
||||
if has(c, global) {
|
||||
winners++
|
||||
}
|
||||
if !has(c, world) {
|
||||
t.Fatal("first in own world denied")
|
||||
}
|
||||
}
|
||||
if winners != 1 || count(global) != 1 || count(world) != 2 {
|
||||
t.Fatal("global first duplicated or world scopes shared")
|
||||
}
|
||||
other, err := a.Join(prefix+"-contender", "Contender")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
a.PendingTitles = []game.TitleCandidate{titleCandidate(a, other, world, "world"), titleCandidate(a, other, global, "global")}
|
||||
if err = la.Save(ctx, a, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if has(other, global) || has(other, world) {
|
||||
t.Fatal("late contender stole first")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("event order beats character map order", func(t *testing.T) {
|
||||
w, l, c := makeWorld("-order")
|
||||
other, err := w.Join(prefix+"-order-other", "Other")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
id := prefix + "-order-title"
|
||||
w.PendingTitles = []game.TitleCandidate{titleCandidate(w, other, id, "world"), titleCandidate(w, c, id, "world")}
|
||||
if err = l.Save(ctx, w, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !has(other, id) || has(c, id) {
|
||||
t.Fatal("first simulation candidate lost")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("late transaction failure rolls back claims and view", func(t *testing.T) {
|
||||
w, l, c := makeWorld("-rollback")
|
||||
id := prefix + "-rollback-title"
|
||||
w.PendingTitles = []game.TitleCandidate{titleCandidate(w, c, id, "global")}
|
||||
before := l.Revision
|
||||
if err := l.SaveCommand(ctx, w, "", &Command{ID: "missing-command"}, ""); err == nil {
|
||||
t.Fatal("missing command committed")
|
||||
}
|
||||
if count(id) != 0 || len(c.View.Titles) != 0 || len(w.PendingTitles) != 1 || l.Revision != before {
|
||||
t.Fatal("failed save leaked title state")
|
||||
}
|
||||
if err := l.Save(ctx, w, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if count(id) != 1 || !has(c, id) {
|
||||
t.Fatal("retry failed after rollback")
|
||||
}
|
||||
if err := l.Release(ctx); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
replacement, _, err := db.Acquire(ctx, w)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer replacement.Release(ctx)
|
||||
stale := prefix + "-stale-title"
|
||||
w.PendingTitles = []game.TitleCandidate{titleCandidate(w, c, stale, "global")}
|
||||
if err = l.Save(ctx, w, ""); err == nil {
|
||||
t.Fatal("stale owner saved")
|
||||
}
|
||||
if count(stale) != 0 || has(c, stale) {
|
||||
t.Fatal("stale owner claimed title")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("victory transfer and stale source", func(t *testing.T) {
|
||||
source, ls, c := makeWorld("-source")
|
||||
id := prefix + "-survivor"
|
||||
source.PendingTitles = []game.TitleCandidate{titleCandidate(source, c, id, "global")}
|
||||
c.View.Level = 2
|
||||
c.View.Experience = 20
|
||||
c.View.ExperienceToNextLevel = 150
|
||||
c.View.StatPoints = 5
|
||||
c.DailySeconds = 123
|
||||
c.View.Entity.State = "eligible"
|
||||
source.Phase = "won"
|
||||
if err := ls.Save(ctx, source, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
survivor, err := db.ReadPassage(ctx, c.View.Entity.ID, c.Account)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !has(survivor, id) {
|
||||
t.Fatal("victory passage missed same-transaction title")
|
||||
}
|
||||
target := game.New(prefix+"-destination", 2, time.Now().UTC(), b)
|
||||
lt, _, err := db.Acquire(ctx, target)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer lt.Release(ctx)
|
||||
if err = target.Import(survivor); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err = lt.Save(ctx, target, c.View.Entity.ID); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !has(survivor, id) || survivor.View.StatPoints != 5 || survivor.View.Experience != 20 || survivor.DailySeconds != 123 {
|
||||
t.Fatal("passage lost progression")
|
||||
}
|
||||
forbidden := prefix + "-source-forbidden"
|
||||
source.PendingTitles = []game.TitleCandidate{titleCandidate(source, c, forbidden, "global")}
|
||||
if err = ls.Save(ctx, source, ""); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if count(forbidden) != 0 || has(c, forbidden) {
|
||||
t.Fatal("old source granted new title")
|
||||
}
|
||||
active, err := db.ActiveCharacter(ctx, c.Account)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if active.WorldID != target.ID || !has(active.Character, id) {
|
||||
t.Fatal("source overwrote destination")
|
||||
}
|
||||
if _, err = db.ReadPassage(ctx, c.View.Entity.ID, c.Account); err == nil {
|
||||
t.Fatal("source reopened spent passage")
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user