Skip to content

chore(currency)!: remove the deprecated English message fields - #207

Open
fjaeckel wants to merge 4 commits into
mainfrom
chore/currency-drop-deprecated-message
Open

chore(currency)!: remove the deprecated English message fields#207
fjaeckel wants to merge 4 commits into
mainfrom
chore/currency-drop-deprecated-message

Conversation

@fjaeckel

Copy link
Copy Markdown
Owner

Stacked on #206 — base is feat/currency-message-keys, so the diff shows only this step. GitHub retargets it to main when #206 merges.

Do not merge until [ninerlog-frontend] and [ninerlog-ios] have shipped key rendering. That is the entire point of the deprecation window: old iOS builds sitting in App Store review must keep working.

What goes

message is removed from ClassRatingCurrency, PassengerCurrency, FlightReviewStatus, CurrencyRequirement and LaunchMethodCurrency. name is removed from regulatory requirements and kept on custom currency rules, where it is pilot-authored user data and was never translatable.

Clients render messageKey / nameKey per docs/CURRENCY_MESSAGES.md.

A bug the removal exposed

NotificationService picks a locale-specific email template from user.PreferredLocale and then interpolated the API's English sentence into it. A German pilot got:

Ihre PPL SEP_LAND Berechtigungsgültigkeit erfordert Aufmerksamkeit: EASA SEP_LAND — revalidation requirements not fully met

German template, English payload. Deleting Message forced the fix rather than letting it hide behind a field nobody looked at.

Emails are server-rendered, so the server needs its own copy of the catalogue: pkg/email/currency_messages.go holds the en and de maps, rendered by locale exactly like every other email string in that package. TestCurrencyMessageCataloguesMatch fails if the two locales drift apart, and TestCurrencyMessagesAreLocalised pins the actual bug — English and German must not render identically.

Dead code the prose was keeping alive

  • reqSpec.msgFmt and reqSpec.name — the format strings existed only to build "12 / 720 minutes in class", which the client now composes from current/required/unit (the web already did this for minutes)
  • plural() — only ever fed English "landing(s)"
  • paxExpiryNote() — passenger expiry now reaches clients solely as dayExpiresOn / nightExpiresOn. Worth noting the web client already ignored pax.message entirely, so this note was only ever visible on iOS
  • Several rating := rt.rating locals and fmt imports that existed only for message formatting

golangci-lint is back to the exact 57-issue main baseline (it briefly went to 58 when plural was orphaned).

Left alone deliberately

passengerPrivilege is still dead surface — declared in types.go and the spec, rendered by the web client, never populated by any Go code. I flagged it on #206 and did not act, because removing it versus implementing it is a product call, not a cleanup one. Say which and I will follow up.

Tests

E2E now asserts the negative: no rating or passenger card may carry a message key at all. The evaluator sweep is unchanged and still requires a catalogued key on every reachable branch.

🤖 Generated with Claude Code

@fjaeckel
fjaeckel force-pushed the chore/currency-drop-deprecated-message branch from 396e370 to 940ef7a Compare August 31, 2026 07:52
Base automatically changed from feat/currency-message-keys to main August 31, 2026 08:22
@fjaeckel
fjaeckel force-pushed the chore/currency-drop-deprecated-message branch from 940ef7a to 0515bd9 Compare August 31, 2026 09:19
fjaeckel and others added 4 commits August 31, 2026 12:20
Completes the message-key migration. The currency payload no longer
carries prose: message is gone from rating, passenger, flight-review,
requirement and launch-method results, and name survives only on custom
currency rules, where it is pilot-authored user data rather than a
translatable string.

Removing the fields exposed a bug they were hiding. The notification
service picked a locale-specific email template via PreferredLocale and
then interpolated the API's English sentence into it, so a German user
received a German template containing English currency prose. The email
package now renders the same key catalogue per locale
(pkg/email/currency_messages.go), and a test keeps the two locale maps
in step.

Dropping the prose also retired the code that only existed to build it:
the msgFmt format strings and name fields on reqSpec, the plural helper,
and paxExpiryNote — passenger expiry now reaches clients solely as the
dayExpiresOn/nightExpiresOn dates.

BREAKING CHANGE: message and name are removed from the currency
response. Clients must render messageKey/nameKey per
docs/CURRENCY_MESSAGES.md. Merge only after the web and iOS clients ship
key rendering.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The e2e helper found requirements by their English name and the passenger
expiry test asserted the date appeared in the message text; neither field
exists once the deprecated prose is removed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
passengerPrivilege was declared on PassengerCurrency and in the spec, and
rendered by the web client, but no code path ever populated it — the
field was always absent from the response and the client branch could
never fire. The two tests covering it only asserted that a struct literal
holds what was put in it, never calling an evaluator, which is how the
surface survived while looking covered.

Also documents that a hint's id from GET /announcements doubles as its
localisation key, while operator-authored announcement text is never
translated — the same user-data rule the currency contract applies to
custom rule names.

BREAKING CHANGE: passengerPrivilege is removed from PassengerCurrency. It
was never populated, so no response content changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The contract said message and name are gone but never listed
passengerPrivilege, which the web client still renders. A client dev
reading the contract now finds what to delete, including the warning
that a test fixture supplying a removed field keeps passing while
covering a surface the API cannot produce.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fjaeckel
fjaeckel force-pushed the chore/currency-drop-deprecated-message branch from 0515bd9 to f39a805 Compare August 31, 2026 10:21
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