Skip to content

camelCase the reading-progress transfer wire format, and unbreak macOS builds - #46

Merged
AshDevFr merged 2 commits into
mainfrom
fix/reading-progress-transfer-camelcase
Sep 28, 2026
Merged

AshDevFr merged 2 commits into
mainfrom
fix/reading-progress-transfer-camelcase

Conversation

@AshDevFr

Copy link
Copy Markdown
Owner

Two independent changes. The first is a build fix that anyone on a current macOS needs; the second is the wire-format change discussed on the transfer work. They are separate commits, so the build fix can be cherry-picked if this takes a while to review.

fix(build): use the system linker on macOS

Homebrew lld cannot resolve libSystem primitives (bzero, memset, lchown, fchown) against the macOS 27 SDK, so every binary and test link dies with hundreds of undefined symbols. Upgrading does not help, the newest published lld has the same problem. Dropping the pin lets Cargo fall back to Apple's ld, which works. Linux keeps mold.

refactor(api): camelCase the transfer payloads

The export document, import request and import report were the only payloads in the API spelling their fields in snake_case. The original reasoning was that the document is a portable interchange file rather than something a frontend deserializes.

It is both, and that is what settles it:

  • GET /reading-progress/export returns the document as a response body.
  • POST /reading-progress/import nests the whole document inside its request at file.

So a camelCase request wrapping a snake_case document would put two naming conventions in one JSON body with no visible boundary, and the frontend reads both through the same generated types.

Only the structs change. The enums (HashMode, ConflictPolicy, SeriesDisposition, BookDisposition, FieldOutcome) keep snake_case variants, matching how enum values are spelled everywhere else in the API. Values like stem_match and skip_existing are unchanged.

The export query parameter goes include_sessions to includeSessions, matching externalId and pluginId elsewhere.

Nothing has consumed the format yet, so this is free now and a breaking change later.

Verification

  • Backend: 5464 passed, 41 skipped
  • Web: 3715 passed across 229 files
  • tsc -b clean, biome clean, clippy clean
  • OpenAPI spec and TypeScript types regenerated

No version bump in this PR, deliberately.

Homebrew lld cannot resolve libSystem primitives (bzero, memset, lchown,
fchown) against the macOS 27 SDK, so every binary and test link fails with
hundreds of undefined symbols. Anyone on a current macOS could not build at
all, and the failure reads as a mess of missing libc symbols rather than as
a linker mismatch, so it costs an afternoon to trace.

Upgrading does not help: the newest published lld has the same problem. Drop
the pin for both macOS targets and let Cargo fall back to Apple's ld, which
works and is fast enough that the lost link time is not worth a broken build.
Linux keeps mold.
The export document, the import request and the import report were the only
payloads in the API spelling their fields in snake_case. The reasoning was
that the document is a portable interchange file rather than something a
frontend deserializes, but it is both: the export returns it as a response
body, and the import nests it inside its request. That second point is what
settles it, because a camelCase request wrapping a snake_case document puts
two naming conventions in one JSON body with no visible boundary between
them, and the frontend reads both through the same generated types.

Only the structs change. The enums keep snake_case variants, which is how
enum values are spelled everywhere else in the API.

Nothing has consumed the format yet, so this is free now and a breaking
change later.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying codex with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5e497fb
Status: ✅  Deploy successful!
Preview URL: https://4a2b8ae7.codex-asm.pages.dev
Branch Preview URL: https://fix-reading-progress-transfe.codex-asm.pages.dev

View logs

@github-actions

Copy link
Copy Markdown

API contract changes

Compared against main. These are changes a client generated from the
previous document would notice. Not a failure: breaking changes are a
release-time decision, and make release-prepare checks the bump against
them when the version is chosen.

Report
82 changes: 49 error, 33 warning, 0 info

@AshDevFr
AshDevFr merged commit 30b3f23 into main Sep 28, 2026
24 checks passed
@AshDevFr
AshDevFr deleted the fix/reading-progress-transfer-camelcase branch September 28, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant