Skip to content

Preserve logbook image payloads and normalize crew IDs#160

Merged
ultimate merged 1 commit into
mainfrom
codex/update-persistence-flow-and-tests
Jul 11, 2026
Merged

Preserve logbook image payloads and normalize crew IDs#160
ultimate merged 1 commit into
mainfrom
codex/update-persistence-flow-and-tests

Conversation

@ultimate

Copy link
Copy Markdown
Owner

Motivation

  • Ensure image metadata attached to boats, crew members, sheet crew entries, and sheets survives normalization and the full save/load cycle.
  • Include crew ID normalization alongside boats and sheets to keep identifiers consistent after import/restore.
  • Make scanner-created sheets explicitly keep image unset unless an image is provided, and validate the full logbook payload on API writes.

Description

  • Update normalizeLogbookIds in app/components/logbook/persistence.ts to generate and return crewIds and to remap crew member IDs on boats, sheets, and sheet crew while preserving existing image properties via object spreads.
  • Tighten payload validation in app/api/logbook/route.ts to require boats, crewMembers, and sheets arrays before accepting a PUT write.
  • Ensure scanner-created sheets do not persist raw upload data by leaving image undefined when not explicitly set in createScannedSheet usage (tests assert image is undefined).
  • Add and update tests to cover image preservation across normalization, repository mapping, API write/read, and scanner-created sheets by modifying/adding tests under tests/app/.

Testing

  • Ran the targeted test suite with Vitest for the modified areas: tests/app/api/logbook-route.test.ts, tests/app/lib/repositories/boats-repository.test.ts, tests/app/lib/repositories/crew-repository.test.ts, tests/app/lib/repositories/log-sheets-repository.test.ts, tests/app/components-logbook-persistence.test.ts, and tests/app/api/logbook-scanner-route.test.ts, and all tests passed.
  • Performed full type checking with tsc --noEmit and linting with eslint ., both succeeding.

Codex Task

@ultimate ultimate added the codex Things in relation to codex (caused by codex or good task for codex) label Jul 11, 2026 — with ChatGPT Codex Connector
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ultilog Ready Ready Preview, Comment Jul 11, 2026 12:22pm

@ultimate ultimate merged commit a1d3cd6 into main Jul 11, 2026
3 checks passed
@ultimate ultimate deleted the codex/update-persistence-flow-and-tests branch July 11, 2026 12:28
@ultimate

Copy link
Copy Markdown
Owner Author

Implements #98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex Things in relation to codex (caused by codex or good task for codex)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant