[GH-ISSUE #2129] [Issue]: Character version history lists older snapshots before newer ones #1038

Closed
opened 2026-10-21 05:25:28 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2129

Originally assigned to: @cha1latte on GitHub.

Summary

Character version history on the refactor branch appears to list saved versions oldest-first, while legacy listed newest-first. This makes recent snapshots harder to find and differs from the legacy version-history route.

Expected behavior

The character version history list should show the most recent saved version first, matching legacy behavior.

Actual behavior

useCharacterVersions lists character-versions with only a characterId filter. The generic storage list path sorts by createdAt ascending unless callers pass descending: true, so the UI likely renders oldest snapshots first.

Steps to reproduce

  1. On the refactor branch, edit a character multiple times so several version snapshots are created.
  2. Open that character in the editor and view Version history.
  3. Compare the ordering against legacy main, where /characters/:id/versions ordered snapshots by descending createdAt.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor static trace on 2026-06-04
  • Run mode: not captured; issue filed from current code inspection on the refactor branch
  • OS + version: not captured
  • Node + pnpm versions: not captured
  • Rust version, if relevant: not captured
  • Remote Runtime URL configured? (yes / no / not relevant): not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

No screenshots or runtime timing attached. Current evidence is from static trace:

  • Refactor src/features/catalog/characters/hooks/use-characters.ts calls storageApi.list<CharacterCardVersion>("character-versions", { filters: { characterId: id } }) without orderBy or descending.
  • Refactor src-tauri/src/commands/storage/commands/entities.rs sorts generic list rows by sortOrder, order, or createdAt, and only reverses order when descending is true.
  • Legacy packages/server/src/services/storage/characters.storage.ts used orderBy(desc(characterCardVersions.createdAt)) for listVersions(characterId).

Regression notes

Legacy main listed version snapshots newest-first. The refactor version-history functionality is otherwise stronger than legacy in this slice because snapshots preserve more avatar metadata and restore snapshots current state first.

Additional context

Found during target 5 parityscan row 05-CHAR-STORAGE-crud-version-history.

Likely narrow fix: request storageApi.list<CharacterCardVersion>("character-versions", { filters: { characterId: id }, orderBy: "createdAt", descending: true }) in useCharacterVersions.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2129 Originally assigned to: @cha1latte on GitHub. ## Summary Character version history on the refactor branch appears to list saved versions oldest-first, while legacy listed newest-first. This makes recent snapshots harder to find and differs from the legacy version-history route. ## Expected behavior The character version history list should show the most recent saved version first, matching legacy behavior. ## Actual behavior `useCharacterVersions` lists `character-versions` with only a `characterId` filter. The generic storage list path sorts by `createdAt` ascending unless callers pass `descending: true`, so the UI likely renders oldest snapshots first. ## Steps to reproduce 1. On the refactor branch, edit a character multiple times so several version snapshots are created. 2. Open that character in the editor and view Version history. 3. Compare the ordering against legacy `main`, where `/characters/:id/versions` ordered snapshots by descending `createdAt`. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` static trace on 2026-06-04 - Run mode: not captured; issue filed from current code inspection on the refactor branch - OS + version: not captured - Node + pnpm versions: not captured - Rust version, if relevant: not captured - Remote Runtime URL configured? (yes / no / not relevant): not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video No screenshots or runtime timing attached. Current evidence is from static trace: - Refactor `src/features/catalog/characters/hooks/use-characters.ts` calls `storageApi.list<CharacterCardVersion>("character-versions", { filters: { characterId: id } })` without `orderBy` or `descending`. - Refactor `src-tauri/src/commands/storage/commands/entities.rs` sorts generic list rows by `sortOrder`, `order`, or `createdAt`, and only reverses order when `descending` is true. - Legacy `packages/server/src/services/storage/characters.storage.ts` used `orderBy(desc(characterCardVersions.createdAt))` for `listVersions(characterId)`. ## Regression notes Legacy `main` listed version snapshots newest-first. The refactor version-history functionality is otherwise stronger than legacy in this slice because snapshots preserve more avatar metadata and restore snapshots current state first. ## Additional context Found during target 5 parityscan row `05-CHAR-STORAGE-crud-version-history`. Likely narrow fix: request `storageApi.list<CharacterCardVersion>("character-versions", { filters: { characterId: id }, orderBy: "createdAt", descending: true })` in `useCharacterVersions`. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:25:28 +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#1038
No description provided.