Skip to main content

🔵 Small Release v2.387.9

⭐ Simple Complexity • 5 commits • 18 files changed
v2.387.9 is a focused stability release that fixes a critical issue preventing first-time players from seeing game completion results, and improves Shopify merchant workflows with search state preservation during configuration. These targeted fixes enhance both end-user experience and platform reliability.

What’s New

  • Game Completion Screen Fix — First-time players can now see game results and rewards immediately after completing a game
  • Shopify Settings Search Persistence — Community settings search now preserves your input when refetching data, eliminating search resets
  • Improved Game Completion Detection — Refined session-ready logic distinguishes between first plays and repeat attempts for accurate result display
  • Configurable Shopify Session Storage — Shopify session collection name is now customizable via environment variable for deployment flexibility

Apps Updated

User App

✓ Updated - 4 changes

Shopify

✓ Updated - 6 changes

Admin

— No changes

API

— No changes

Games

— No changes

MCP Server

— No changes

Detailed Changes

Game Completion Screen Stability
  • Game Completion Hang Fix (NJ-1169) — Fixed critical issue where first-time players’ game-complete screens would hang indefinitely and fail to show results. The issue was in the session-ready detection logic which incorrectly used the current session as a baseline, causing first-time players to never receive a “new session detected” signal. The fix separates first-play logic (any completed session is ready) from repeat-play logic (new completed session must differ from prior), with comprehensive test coverage.
Session Completion Detection
  • Extracted isCompletedSessionReady Helper (NJ-1169) — New isCompletedSessionReady() function encapsulates the readiness logic with clear semantics: readiness is “the latest session is completed”, NOT “the latest session differs from the one before play”. Tests validate all scenarios: missing sessions, in-progress sessions, first-time completion, and repeat-play detection.
  • Server-Side Game Data Seeding (NJ-1169) — Game-complete wrapper now seeds React Query cache with server-fetched game data (which includes the just-completed session), preventing data loss during client-side polling and enabling immediate result display.
Settings Search UX
  • Settings Community Search Persistence (NJ-1185) — Community selector in Shopify settings now preserves your search input and results when the query refetches, eliminating the frustrating behavior where search was reset on every data refresh. Uses React Query’s keepPreviousData option to hold stale results while fetching fresh data.
  • Search Query Testing (NJ-1185) — Added harness E2E test verifying search persistence flow, ensuring the UX remains stable through future refactors.
Session Configuration
  • Configurable Session Collection Name (NJ-1193) — Shopify session collection MongoDB name is now configurable via the SHOPIFY_SESSION_COLLECTION_NAME environment variable, eliminating hardcoded defaults and supporting flexible deployment scenarios.
  • Session Service Configuration (NJ-1193) — Updated Shopify session service and initialization to use the environment variable, with dev-setup documentation updated to show the configuration option.

Admin Highlights

  • Shopify Community Search Persistence – Settings community selector now preserves search input during data refetch, preventing manual re-entry
  • Configurable Session Storage – Shopify session collection name customizable via environment variable for deployment flexibility

User Highlights

  • Game Completion Results Guaranteed – First-time game players now see results immediately after completing a game without hanging or delays
  • Reliable Game Results Display – Session detection logic now correctly identifies game completion for both first plays and repeated attempts

Breaking Changes

None. All changes are backwards-compatible.

Technical Notes

Game Session Logic
  • The game-complete screen polling mechanism distinguishes between two readiness conditions:
    • First play (no prior session): Ready when latestSession.completedAt exists
    • Repeat play (prior session exists): Ready when a different session becomes latest AND completed
  • Prior buggy logic conflated these cases, causing first-time players to wait indefinitely for a “different” session
  • The extracted isCompletedSessionReady() function makes this distinction explicit with comprehensive test coverage for all branches
Data Flow
  • Server-side page renders game with completed session already present
  • Client-side wrapper seeds React Query cache with this data via setQueryData() to prevent race conditions
  • Polling loop checks readiness on refetch without clobbering fresher background fetches (guarded by seededRef)
Shopify Search UX
  • React Query’s keepPreviousData option holds stale search results while new data is fetching
  • This provides instant visual feedback instead of clearing the list mid-refresh, creating a smoother merchant experience

Usage Examples

// Game completion readiness logic (User App)
import { isCompletedSessionReady } from './is-completed-session-ready';

// For first-time players (no prior session)
isCompletedSessionReady(
  { sessionId: 'new', completedAt: '2026-06-17T11:44:06Z' },
  null  // No prior session
); // Returns: true ✓

// For repeat plays (must differ from prior)
isCompletedSessionReady(
  { sessionId: 'new', completedAt: '2026-06-17T11:44:06Z' },
  'prior'  // Prior session exists
); // Returns: true (different session) ✓

// While in-progress (not ready regardless)
isCompletedSessionReady(
  { sessionId: 'new', completedAt: null },
  'prior'
); // Returns: false ✓

Contributors

dch@wenudj.com@dch2 commits • +254/-12 lines

jamescockayne@jamescockayne1 commit • +49/-10 lines

solicshop@gmail.com@solicshop1 commit • +104/-31 lines

nudj-changelog-bot[bot]@nudj-changelog-bot[bot]1 commit • +0/-0 lines

Release Stats

MetricValue
Total Commits5
Lines Added+705
Lines Removed-54
Files Changed18
Release Size🔵 Small
Complexity⭐ Simple

v2.387.9 deployed on June 17, 2026