> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nudj.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# v2.407.13

> Released June 30, 2026

## 🟠 v2.407.13 Release

⭐⭐ Moderate Complexity • 14 commits • 51 files changed

<Note>
  Quick admin workflows, Safari game compatibility, and AI-powered reward management. This release fixes critical admin editing issues, adds automatic cache refresh when AI creates or modifies rewards, resolves Safari tap-to-play compatibility, and improves Shopify integration stability with dynamic URL resolution and deep linking to the theme editor.
</Note>

## What's New

* **Instant rewards cache refresh** – When Ask Nudj creates or updates rewards, the admin Rewards list, stat cards, and onboarding checklist now refresh automatically without a manual page reload
* **Rich-text rewards are editable again** – Fixed a database issue where AI-generated rewards with rich-text descriptions became unsavable; old corrupted data is automatically cleaned up during upgrade
* **Redemption code uploads now enable Save** – Fixed the admin reward form so uploading redemption codes properly marks the form as dirty and enables the Save button
* **Safari users can now tap to play games** – Fixed Basketball and other games to reliably start on Safari by handling the browser's non-standard pointer event behavior
* **Shopify widget resolves URLs dynamically** – The Shopify widget now resolves the user app URL from platform configuration instead of using hardcoded values, enabling cleaner deployments
* **Loyalty Hub setup links to theme editor** – Shopify admins can now click "Loyalty Hub" in the on-site content settings to open the real Shopify theme editor for widget customization
* **AI agent knows which community you're in** – MCP tool calls from Ask Nudj now include community context, so the agent creates and updates challenges and rewards in the right place
* **Entity caches refresh after edits** – All challenge, reward, achievement, and post edits now refresh their admin data automatically, eliminating stale data after saves
* **Widget session cookies are partitioned** – Improved security and privacy in iframe contexts by properly partitioning the widget's session cookie

## Apps Updated

<CardGroup cols={3}>
  <Card title="User App" icon="mobile">
    ✓ Updated - Widget iframe session cookie partitioning
  </Card>

  <Card title="API" icon="server">
    — No changes
  </Card>

  <Card title="Admin" icon="gear">
    ✓ Updated - Cache refresh, form validation, AI context
  </Card>

  <Card title="MCP Server" icon="robot">
    — No changes
  </Card>

  <Card title="Games" icon="gamepad">
    ✓ Updated - Safari pointer event handling
  </Card>

  <Card title="Database" icon="database">
    ✓ Updated - Reward data cleanup migration
  </Card>
</CardGroup>

## Detailed Changes

<AccordionGroup>
  <Accordion title="Admin App" icon="gear" defaultOpen>
    **Automatic Rewards Cache Refresh (NJ-1355)**

    * When Ask Nudj creates or updates rewards via MCP tools, the admin app now detects the successful mutation and automatically refreshes:
      * The Rewards list and pagination table
      * Reward count stat cards (asset and giveaway overviews)
      * The onboarding guide status (if the first reward was just created)
    * No manual page reload required—data updates live as you create

    **Redemption Form Validation Fix (NJ-1356)**

    * Fixed issue where uploading redemption codes didn't mark the form as dirty
    * Save button now properly enables when you upload codes or make other redemption-step changes
    * Prevents accidental data loss from unsaved edits

    **Entity Cache Invalidation (WS-567)**

    * All challenge, achievement, post, and reward mutations now automatically invalidate their admin cache
    * Create, update, archive, and delete operations all refresh the list and detail views
    * Eliminates stale data after saves without requiring a manual page reload

    **MCP Community Context (NJ-1295)**

    * Ask Nudj now includes the current community context when calling MCP tools
    * Ensures AI-generated challenges and rewards are created in the correct community
    * Prevents cross-community errors when bulk-managing multiple communities
  </Accordion>

  <Accordion title="Games App" icon="gamepad">
    **Safari Tap-to-Play Compatibility (NJ-1328)**

    * Fixed Basketball game (and other tap-to-play games) to work reliably on Safari
    * Safari reports pointer events with `button: -1` instead of standard button values
    * Added special case handling for Safari's pointer event quirk
    * Game now starts consistently on iOS Safari, Chrome, Firefox, and other browsers
  </Accordion>

  <Accordion title="Shopify Integration" icon="shopping-cart">
    **Dynamic Widget URL Resolution (NUDJ-0000, #3273)**

    * Widget now resolves the user app URL from platform configuration at runtime
    * Removes hardcoded URL dependency, enabling cleaner multi-environment deployments
    * Fixes widget functionality when deployed to custom domains or preview environments

    **Loyalty Hub Setup Deep Link (NJ-1272, #3229)**

    * "Loyalty Hub" button in Shopify on-site content settings now opens the real Shopify theme editor
    * Admins can customize the widget appearance without leaving the theme editor
    * Marked "Nudges" as "Coming soon" (placeholder for future notification system)

    **Widget Session Cookie Partitioning (NUDJ-0000, #3261)**

    * Improved security by properly partitioning widget iframe session cookies
    * Complies with modern browser privacy standards (SameSite attributes)
    * Reduces tracking surface area for embedded widgets
  </Accordion>

  <Accordion title="Database" icon="database">
    **Reward Data Integrity Migration (NJ-1349, #3260)**

    * Migration cleans up stale code-only fields on non-code rewards
    * Affected rewards: mostly AI-generated rewards with rich-text descriptions that carried leftover `store` and `code` fields
    * Symptom was "redemptionConfig.store: Expected undefined, received string" validation error blocking all saves
    * Migration runs automatically on upgrade; no admin action required
    * Fixes editability of previously unsavable rewards
  </Accordion>
</AccordionGroup>

## Contributors

<CardGroup cols={2}>
  <Card>
    <img src="https://github.com/jamescockayne.png" alt="jamescockayne" style={{borderRadius: '50%', width: 48}} />

    **@jamescockayne**

    3 commits • +328/-17 lines
  </Card>

  <Card>
    <img src="https://github.com/dch.png" alt="dch" style={{borderRadius: '50%', width: 48}} />

    **@dch**

    3 commits • +841/-219 lines
  </Card>

  <Card>
    <img src="https://github.com/erek_d.png" alt="erek_d" style={{borderRadius: '50%', width: 48}} />

    **@erek\_d**

    2 commits • +2989/-64 lines
  </Card>

  <Card>
    <img src="https://github.com/tomcarroll09.png" alt="tomcarroll09" style={{borderRadius: '50%', width: 48}} />

    **@tomcarroll09**

    1 commit • +84/-1 lines
  </Card>
</CardGroup>

## Release Stats

| Metric        | Value       |
| ------------- | ----------- |
| Total Commits | 14          |
| Lines Added   | +5,330      |
| Lines Removed | -320        |
| Files Changed | 51          |
| Complexity    | ⭐⭐ Moderate |
| Size          | 🟠 Large    |

## Migration Notes

**Database Migration Required**: The automatic reward data cleanup migration will run on startup. This is a safe, read-only-first migration that only removes invalid fields from rewards with non-code redemption types. No admin action needed.

***

*v2.407.13 deployed on June 30, 2026*
