[PR #11] [MERGED] Fix attachments persistence, playerStats wipe, TLS redirect URI, and UX edge cases #4391

Closed
opened 2026-10-22 04:07:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/11
Author: @Copilot
Created: 3/10/2026
Status: ✅ Merged
Merged: 3/10/2026
Merged by: @SpicyMarinara

Base: release/1.3.0 ← Head: copilot/sub-pr-9-again


📝 Commits (2)

  • 11d9c76 Initial plan
  • 263f779 fix: address PR #10 review comments (attachments, playerStats, TLS, manifest)

📊 Changes

6 files changed (+28 additions, -12 deletions)

View changed files

📝 packages/client/public/manifest.json (+2 -2)
📝 packages/client/src/components/chat/ChatInput.tsx (+1 -0)
📝 packages/client/src/lib/slash-commands.ts (+1 -0)
📝 packages/server/src/index.ts (+18 -5)
📝 packages/server/src/routes/generate.routes.ts (+4 -4)
📝 packages/server/src/routes/spotify-auth.routes.ts (+2 -1)

📄 Description

Several bugs from the PR #10 review: attachments-only messages were never persisted, playerStats was reset to null on every generation, the Spotify OAuth redirect URI ignored TLS config, and attachments leaked across slash commands.

Server

  • Attachments-only messages: Message creation now triggers when attachments.length > 0 even if userMessage is empty, with content defaulting to "" so images-only sends are stored against the correct turn
  • playerStats preservation: World-state snapshot creation carries forward prevSnap.playerStats instead of hardcoding null, with safe string/object detection before JSON.parse
    // before
    playerStats: null,
    // after
    playerStats: (gs.playerStats as any[]) ??
      (prevSnap?.playerStats
        ? (typeof prevSnap.playerStats === "string" ? JSON.parse(prevSnap.playerStats) : prevSnap.playerStats)
        : null),
    
  • Spotify redirect URI scheme: getRedirectUri() now derives http/https from SSL_CERT/SSL_KEY env vars
  • TLS startup errors: loadTlsOptions() throws a descriptive error with cert/key paths on read failure; main() catches and exits cleanly instead of crashing with a raw stack trace

Client

  • Slash command attachment leak: setAttachments([]) added to the slash command path — previously queued attachments silently carried over to the next send
  • SlashCommandContext.generate type: Added optional attachments?: { type: string; data: string }[] to unblock multimodal slash command generations
  • manifest.json icon sizes: Replaced "any" with actual pixel dimensions (64x64, 1655x1322) to fix PWA install validation in strict browsers

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/11 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 3/10/2026 **Status:** ✅ Merged **Merged:** 3/10/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `release/1.3.0` ← **Head:** `copilot/sub-pr-9-again` --- ### 📝 Commits (2) - [`11d9c76`](https://github.com/Pasta-Devs/Marinara-Engine/commit/11d9c7670e283e3986087d380b9c771cdd965818) Initial plan - [`263f779`](https://github.com/Pasta-Devs/Marinara-Engine/commit/263f779700a60a1ea9643323fbb52026d03ec8b9) fix: address PR #10 review comments (attachments, playerStats, TLS, manifest) ### 📊 Changes **6 files changed** (+28 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/public/manifest.json` (+2 -2) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+1 -0) 📝 `packages/client/src/lib/slash-commands.ts` (+1 -0) 📝 `packages/server/src/index.ts` (+18 -5) 📝 `packages/server/src/routes/generate.routes.ts` (+4 -4) 📝 `packages/server/src/routes/spotify-auth.routes.ts` (+2 -1) </details> ### 📄 Description Several bugs from the PR #10 review: attachments-only messages were never persisted, `playerStats` was reset to `null` on every generation, the Spotify OAuth redirect URI ignored TLS config, and attachments leaked across slash commands. ## Server - **Attachments-only messages**: Message creation now triggers when `attachments.length > 0` even if `userMessage` is empty, with `content` defaulting to `""` so images-only sends are stored against the correct turn - **`playerStats` preservation**: World-state snapshot creation carries forward `prevSnap.playerStats` instead of hardcoding `null`, with safe string/object detection before `JSON.parse` ```ts // before playerStats: null, // after playerStats: (gs.playerStats as any[]) ?? (prevSnap?.playerStats ? (typeof prevSnap.playerStats === "string" ? JSON.parse(prevSnap.playerStats) : prevSnap.playerStats) : null), ``` - **Spotify redirect URI scheme**: `getRedirectUri()` now derives `http`/`https` from `SSL_CERT`/`SSL_KEY` env vars - **TLS startup errors**: `loadTlsOptions()` throws a descriptive error with cert/key paths on read failure; `main()` catches and exits cleanly instead of crashing with a raw stack trace ## Client - **Slash command attachment leak**: `setAttachments([])` added to the slash command path — previously queued attachments silently carried over to the next send - **`SlashCommandContext.generate` type**: Added optional `attachments?: { type: string; data: string }[]` to unblock multimodal slash command generations - **`manifest.json` icon sizes**: Replaced `"any"` with actual pixel dimensions (`64x64`, `1655x1322`) to fix PWA install validation in strict browsers <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:07:12 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4391
No description provided.