Skip to content

fix(emotes): keep emote bar reads distinct, lenient and atomic on save - #112

Merged
diangogav merged 1 commit into
mainfrom
feat/emote-bar
Oct 15, 2026
Merged

diangogav merged 1 commit into
mainfrom
feat/emote-bar

Conversation

@diangogav

@diangogav diangogav commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • When slots go stale, each one falls back to the first default emote not used by another slot. The 8 returned refs are always distinct.
  • Saving is one INSERT ... ON CONFLICT (user_id) DO UPDATE statement. Two concurrent first saves can no longer fail with a primary key violation.
  • Reading a stored bar never throws. A malformed, repeated or unusable ref reads as a stale slot, and a stored array of the wrong length reads as the default bar. Saving stays strict.
  • The pack slug is derived from assetRef without assuming a trailing slash, and empty or nested slugs are ignored.
  • The router auth tests send a body only on PUT.

Chain context

This is part of the emote packs feature: emote packs become cosmetics, and each player builds an 8-slot emote bar from the default emotes and the emotes of packs they own. The duel server already relays any emote id up to 48 bytes (diangogav/EDOpro-server-ts#418).

This is a stacked chain into main. Merge the PRs in order. After each merge, retarget the next PR to main.

main
└── #109 EMOTE_PACK cosmetic type and pack validation
  └── #110 emote bar domain and persistence
    └── #111 GET and PUT /me/emote-bar
      └── #112 emote bar fixes 📍
  • Starts from: feat(emotes): add GET and PUT /me/emote-bar #111.
  • Ends at: the emote bar API is complete for the player's own bar.
  • Follow-up: the public emote bar endpoint, so opponents can play a sender's pack emotes.
  • Out of scope: the client and the backoffice.

Size

328 changed lines: 104 production, 224 tests.

Verification

  • bun test: 683 pass, 0 fail.
  • bun run lint and bun run build --noEmit are clean.

Base automatically changed from feat/emote-bar-api to main October 15, 2026 00:05
@diangogav diangogav self-assigned this Oct 15, 2026
@diangogav
diangogav merged commit 997d9d5 into main Oct 15, 2026
1 check passed
@diangogav
diangogav deleted the feat/emote-bar branch October 15, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant