SerializePayload was using default JsonSerializerOptions, so record properties
like GetStarterDecksResponse.Decks were serialized as "Decks" (PascalCase).
That JsonElement travels through the NATS reply back to the gateway, which
forwards it verbatim. The client reads p.get("decks", []) and finds nothing
→ "No starter decks available."
Fix: use the same PropertyNamingPolicy=CamelCase that SystemTextJsonSerializer
uses, so all payload field names arrive at the client in camelCase.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Same two classes of bug as PrebuiltDeckEditor:
1. AddAsset / AddAnimation — ValueGeneratedOnAdd sentinel mismatch:
New entities with Id = Guid.NewGuid() added to a tracked ObservableHashSet
are classified as Modified by EF, causing a 0-rows-affected UPDATE.
Fix: Db.Entry(entry).State = EntityState.Added when !_isNew.
2. RemoveAsset / RemoveAnimation — redundant Db.Remove on detached entity:
Id != Guid.Empty is always true (Guid.NewGuid() default). Removing an
Added entity from the collection detaches it; calling Db.Remove re-attaches
it as Deleted → DELETE on a non-existent row → DbUpdateConcurrencyException.
Fix: removed the explicit Db.Remove calls; EF handles orphan deletion.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
PrebuiltDeckCard.Id is configured as ValueGeneratedOnAdd; EF's sentinel for
Guid is Guid.Empty. When a new entity with Id = Guid.NewGuid() is added to
the tracked ObservableHashSet (_deck.Cards), EF interprets the non-empty Guid
as an existing row and tracks the entity as Modified instead of Added.
SaveChangesAsync then issues an UPDATE that finds 0 rows →
DbUpdateConcurrencyException.
Fix: call Db.Entry(entry).State = EntityState.Added immediately after adding
to the collection for existing (tracked) decks. For new decks the plain
List<> is not yet tracked so graph traversal in SaveAsync handles it.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
PrebuiltDeckCard.Id is always a NewGuid() (never Guid.Empty), so the
old `if (entry.Id != Guid.Empty) Db.PrebuiltDeckCards.Remove(entry)`
guard was always true. When a user added a card then removed it before
saving, EF detached the Added entity from the collection, then the
explicit Db.Remove re-attached it as Deleted. SaveChangesAsync then
tried to DELETE a row that was never inserted → DbUpdateConcurrencyException.
Drop the explicit remove call entirely. EF Core automatically marks
Unchanged orphans as Deleted when removed from a required relationship
collection, and simply detaches Added orphans — both are the correct
outcomes without any extra Db.Remove.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
PrebuiltDeckEditor.razor:
- Add Db.ChangeTracker.Clear() at OnInitializedAsync start to prevent
stale Deleted/Modified entities from prior circuit pages causing
DbUpdateConcurrencyException on save
- Replace @bind + button-only search with @oninput + 300ms debounce for
both card and arch-spirit search inputs (results appear as you type;
search button retained as manual fallback)
- Clearing the input immediately clears previous results
LoginScreen.tscn:
- Set virtual_keyboard_type = 5 (EMAIL_ADDRESS) on EmailInput and
RegEmailInput so Godot's experimental virtual keyboard creates
<input type="email"> instead of type="text" on mobile/web
export_presets.cfg:
- Extend head_include with a MutationObserver that watches for virtual
keyboard INPUT elements and sets autocomplete="username" on email
inputs and autocomplete="current-password" on password inputs,
enabling iOS Face ID / Touch ID password vault autofill
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Auth (single-session policy):
- AuthGrpcHandler.Login now calls RevokeAllSessionsForUserAsync before
CreateSessionAsync. When a user logs in on a new device, all existing
sessions are revoked in Redis (token keys deleted) and marked RevokedAt
in Postgres. The old device will fail auth.hello on its next reconnect
and return to the login screen automatically.
Admin (PrebuiltDeckEditor):
- SearchCardsAsync and SearchArchSpiritsAsync were using .Contains() which
compiles to a case-sensitive PostgreSQL LIKE. Changed to EF.Functions.ILike
so card names can be found regardless of capitalisation.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Add .AsSplitQuery() to ContentSyncHandler to prevent the cartesian
product join caused by two collection .Include()s (Assets + AnimationBindings).
EF was executing a single JOIN that multiplied result rows per card,
causing replies to arrive 10+ seconds late and gateway timeouts.
- Bump Gateway__RemoteDispatchTimeoutMs from 10000 → 15000ms in configmap
to give worker pods headroom on cold starts (EF model compilation +
first DB query can take 3-5 seconds on a fresh pod).
NOTE: restart gateway pods after deploying to pick up the new timeout value:
kubectl rollout restart deployment/sor-gateway -n stone-server
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Search card definitions by name (ILike, top 20), click a row to select,
set quantity (1–99), toggle Tradeable + Foil, then Grant.
Creates PlayerCard rows directly in CollectionDbContext.
Injects CatalogDbContext + CollectionDbContext (both already registered).
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Shows all key-value properties for an account in a table with
inline editing (pencil → edit field → save/cancel) and delete per row.
Add-new form below the table: key + value → Add button.
Duplicate-key guard prevents adding an existing key; existing entries
must be edited rather than added again.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Server:
- ConnectionLoop: accept auth.login and auth.register as valid first messages
(not just auth.hello); all ack payloads now include sessionToken for client
persistence
- IGatewayAuthValidator: add LoginAsync and RegisterAsync
- GatewayAuthValidator: implement both via auth gRPC; fetch displayName from
ValidateAsync after login/register succeeds
- Admin hamburger: custom .sor-admin-hamburger CSS (hardcoded white, no Bootstrap
btn-link theme fighting); topbar z-index 1050 with position:sticky
Client (Godot 4.5, GDScript):
- autoloads/Network.gd: WebSocketPeer state machine (CONNECTING / CONNECTED /
RECONNECTING), exponential backoff (1→30s), app-level keepalive ping every
30s of idle, 30s ping timeout → reconnect, request/reply correlation by
sequence number, debug_log_packets export flag for full packet dumps
- autoloads/Auth.gd: drives auth.hello / auth.login / auth.register as first
WS message; persists sessionToken + userId + displayName to user://auth.cfg;
auto-resumes saved session on reconnect; auth_success / auth_failed signals
- scenes/login/LoginScreen.tscn + login_screen.gd: Login + Register tabs,
touch-friendly inputs (44px height), status label, Enter key submits, handles
reconnect/resume states
- scenes/main/MainScreen.tscn + main_screen.gd: top bar with live connection
dot, welcome label, placeholder nav buttons, sign-out, redirects to login on
session expiry
- project.godot: Network and Auth autoloads registered; LoginScreen as main scene
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
app.css:
- New .sor-admin-outer wrapper (flex column, 100vh) so topbar + shell stack vertically
- .sor-admin-shell changed from height:100vh to flex:1 (fills remaining space)
- .sor-admin-topbar: hidden on desktop (display:none), shown at <992px as a 56px
dark strip hosting the hamburger button and brand
- .sor-admin-sidebar: at <992px becomes a fixed overlay drawer (position:fixed,
translateX(-100%)), slides in with .open class (0.25s ease-in-out transition)
- .sor-admin-backdrop: full-screen dim overlay (z-index 1040), hidden on desktop
- Minor: tighter container-fluid padding on small screens
MainLayout.razor:
- Wrapped authorized shell in .sor-admin-outer
- Added mobile topbar with hamburger (<i class="bi bi-list">) + brand
- Added backdrop div rendered conditionally when _drawerOpen
- Drawer state (_drawerOpen bool) managed here; toggled by hamburger, closed
by backdrop click and automatically on any NavigationManager.LocationChanged
- Implements IDisposable to unsubscribe LocationChanged event handler
- Passes IsOpen parameter to NavMenu
NavMenu.razor:
- Added [Parameter] public bool IsOpen { get; set; }
- Applies "open" CSS class to <nav> when IsOpen is true
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
BoosterPackEditor.razor:
- New SlotKind enum: Rarity, Specific, RandomFromSet, Random
- Pack-level default CardSet picker (maps to BoosterPack.CardSetId)
- Per-slot UI: Rarity (rarity + set override), Specific (card GUID + name resolve),
RandomFromSet (set dropdown), Random (any published card)
- Backwards-compatible SlotsJson parse (detects legacy lowercase format)
- Slot legend card explaining all 4 types
BazaarBuyBoosterPackHandler.cs:
- Replace old SlotEntry record with JsonElement-based parsing
- Rarity slots: slot-level SetId → pack.CardSetId → all sets
- Specific slots: guarantee exact CardDefinitionId (Count ≥ 1 for duplicates)
- RandomFromSet slots: random from a given set, no rarity filter
- Random slots: random from all published cards
- Refund OriginPoints on bad SlotsJson before returning error
- Extract CreateAndTrackCard helper to deduplicate PlayerCard creation
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- PushUnitEffect and PullUnitEffect gain BlockedDamage (int): deals direct HP
damage to the displaced unit if it cannot complete the full tile distance
(blocked by a boundary or another unit)
- AbilityRange gains RequiresLos (bool): engine validates line of sight before
allowing ability activation
- AbilityRange gains LinearOnly (bool): restricts targeting to cardinal/diagonal
straight lines only (suitable for Push/Pull/beam abilities)
- AbilityBuilder UI exposes RequiresLos and LinearOnly as inline checkboxes in
the Active ability range row
- PushUnit/PullUnit effect templates auto-populate with BlockedDamage: 0
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
• Light/dark mode toggle: Bootstrap 5.3 data-bs-theme, theme persisted to
localStorage via admin.js, Moon/Sun icon button in sidebar, flash-free
inline <script> in App.razor applies saved theme before first render.
• Account management: Add "Create Account" button + new /accounts/new page
(email, display name, password, role checkboxes). AccountDetail now has
interactive role assignment (Add/Remove Admin/SuperAdmin — SuperAdmin
actions gated with <AuthorizeView Roles="SuperAdmin">) and a force-reset
password section (RemovePasswordAsync + AddPasswordAsync, no current
password required).
• Chat fixes: stat card labels changed from text-muted → text-white-50 for
readability on bg-dark; card-headers now have border-bottom border-secondary
to visually separate from card bodies; "View" button relabeled "View & Post"
to surface the hidden compose feature.
• Ability builder (AbilityBuilder.razor): structured UI replacing the raw
textarea in CardEditor. Supports all 4 ability types (Active/Passive/Aura/
Triggered) with type-specific fields (range, uses/turn, aura range, trigger
dropdown). Each ability holds structured actions (scope/type/ownership/count
dropdowns) and effects (59 types in 11 grouped optgroups; each auto-populates
a JSON fields template on type selection). Description field stores plain-
English text in the JSON. Raw JSON toggle + Apply for power users. Live
compiled JSON preview.
• AbilitySystem: added JsonStringEnumConverter so JSONB enums serialize as
human-readable strings ("Active" vs 0, "Battlefield" vs 3, etc.).
• AbilityDefinition: added optional Description property (admin-only metadata).
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- MainLayout.razor: wrap shell in <AuthorizeView> so the sidebar and
nav are only rendered when the user is logged in. Unauthenticated
pages (login) render @Body directly, giving the login card its full
viewport without the nav overlay.
- deployment-admin.yaml: inject Admin__Email / Admin__Password from
sor-app-secrets so the startup seed picks up production credentials.
- sor-app-secrets.yaml.template: add Admin__Email / Admin__Password
placeholder entries with instructions.
- secrets/README.md: document the two new seed-account keys.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- DesignTimeFactories.cs: adds IDesignTimeDbContextFactory<T> for all
6 contexts so dotnet-ef tools work without starting the full ASP.NET
host (previously failed because Redis/NATS aren't available locally)
- SOR.Host.csproj: adds Microsoft.EntityFrameworkCore.Design (PrivateAssets=all)
as the EF design-time host still requires it in the startup project
- Game/AddGameRulesAndCustomLobby: emptied Up/Down — migration was generated
with a stale snapshot duplicating InitialCreate tables; actual GameRuleSet
and CustomLobby schema is in AddBoardDimensions
- deploy/database-migrations.md: documents how to apply/add migrations
against any environment; records pg-forge-01 state as of 2026-02-27
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Replace custom HttpCdnClient (proprietary upload API) with S3CdnClient
backed by AWSSDK.S3 using ForcePathStyle for Ceph RadosGW compatibility.
CdnOptions gains EndpointUrl/AccessKey/SecretKey/BucketName; removes
UploadBaseUrl/ApiKey. K8s deployments and secrets template updated to
match new config keys.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Add EnterAuraRange and LeaveAuraRange to TriggerEventKind enum
- Add TriggerMatches cases for OnEnterAuraRangeTrigger / OnLeaveAuraRangeTrigger
with AuraOwnership + UnitOwnerMatches (ally/enemy/any) scope filtering
- Add EvaluateAuraTransitions (on move), EvaluateAurasOnEnter (on channel),
EvaluateAurasOnLeave (on sacrifice/kill) public methods to AbilitySystem
- Bidirectional evaluation: moving unit vs. stationary auras + moving unit's
own auras vs. stationary units
- Hook into GameEngine: MoveUnit, ChannelCard (Spirit), Sacrifice
- KillUnit now calls EvaluateAurasOnLeave before board removal
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- ExecuteEffect now builds and stores reversal effects in GameState.ActiveEffects
for all non-Instant durations (stat deltas, flag toggles, genus, affinity)
- DOT/HOT effects register tick entries instead of reversals
- TrackedDuration wrapper records owner + IsTick flag alongside DurationModel
- ExpireActiveEffects handles UntilEndOfTurn, UntilStartOfOwnerTurn, ForNTurns,
WhileCondition; applies reversal on expiry for non-tick entries
- TickActiveEffects fires DOT/HOT damage/healing each turn end
- GameEngine.EndTurn: tick → expire(end) after TurnEnd trigger;
expire(start) after player switch, before TurnStart trigger
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>