Skip to content

sync upstream v0.12.7#7

Merged
mxyhi merged 4 commits intomainfrom
sync-upstream-v0.12.7
Apr 12, 2026
Merged

sync upstream v0.12.7#7
mxyhi merged 4 commits intomainfrom
sync-upstream-v0.12.7

Conversation

@mxyhi
Copy link
Copy Markdown
Owner

@mxyhi mxyhi commented Apr 12, 2026

Summary

This PR syncs our fork from the previously imported upstream v0.12.6 baseline to the latest official upstream release v0.12.7.

The user-facing effect is that our fork now picks up the official quota input UX upgrade, pricing error UX cleanup, login error handling refinement, and token authentication hardening from upstream without bringing in any nightly-only changes.

Why this sync is needed

Our current origin/main was still aligned to the earlier upstream v0.12.6 sync. Upstream has since published v0.12.7, which includes official fixes and UX improvements that should land in the fork, but the nightly branch also contains additional unreleased tiered-billing work that we explicitly do not want to import as part of a stable sync.

Because this fork does not share a clean merge base with upstream in a way that supports a straightforward release merge, directly merging the upstream tag would not produce a safe or reviewable result.

Root cause

Historically, this fork has been synced by importing upstream release commits rather than maintaining a simple merge relationship against upstream branches. As a result, HEAD and the upstream release tag do not have a usable merge base for a clean release merge in this repo.

What changed

I synced the official v0.12.7 release by cherry-picking the four release commits between upstream v0.12.6 and v0.12.7 in order:

  • 040e8c1d feat: replace quota input with amount-first UI and atomic quota adjustment
  • ed7f8399 feat: improve model price error UX with role-aware messages and cleaner UI
  • 2819e3a1 fix: improve login error handling to distinguish database errors from auth failures
  • 59c582d1 fix: harden token auth error handling to prevent info leakage

This PR intentionally does not include unreleased commits currently on upstream/main, and it does not include nightly-only tiered billing work.

Conflict resolution

Three conflicts were resolved during the sync:

  1. .gitignore

Kept both the local planning-file ignores and the upstream token_estimator_test.go ignore entry.

  1. web/src/components/table/redemptions/modals/EditRedemptionModal.jsx

Our fork already adds subscription-plan redemption support, while upstream v0.12.7 introduces amount-first quota input. The final merged result preserves both behaviors:

  • subscription redemption still works as before
  • quota redemption now uses the upstream amount-first input flow
  • raw quota input remains available behind the collapsible advanced input
  1. model/redemption.go

Upstream moved ErrRedeemFailed into model/errors.go as part of auth/error hardening. The fork-local duplicate definition in model/redemption.go was removed so the new centralized error source remains authoritative while preserving the fork's subscription redemption logic.

Validation

I ran the following checks after the sync:

  • go test ./...
  • cd web && bun run build

Both completed successfully.

…tment

- Refactor token, redemption, and user quota inputs to prioritize monetary
  amount entry, with raw quota input collapsed by default
- Add atomic quota adjustment modal for users with add/subtract/override modes,
  bypassing batch update queue for immediate DB consistency
- Make user quota fields readonly in edit form; all modifications go through
  the dedicated adjust-quota modal via POST /api/user/manage
- Add DecreaseUserQuota `db` parameter for direct DB writes, matching
  IncreaseUserQuota behavior
- Support negative quota display in amount conversion helpers
- Add i18n keys for all new UI strings across all locales
…er UI

- Backend: differentiate error messages for admin vs regular users in price.go
- Backend: include error_code in channel test response for structured error handling
- Frontend: render model_price_error as a styled card in Playground with admin nav button
- Frontend: show inline error details and settings link in channel test modal
- Frontend: parse error codes from both SSE and non-streaming API responses
- i18n: remove redundant "Settings" suffix from setting tab translations (en/fr/ru/ja/vi)
- i18n: update "Group & Model Pricing" translations across all locales
… auth failures

ValidateAndFill now checks the DB query result and returns sentinel errors
(ErrDatabase, ErrInvalidCredentials, ErrUserEmptyCredentials) instead of
hardcoded Chinese strings. The controller maps each sentinel to the
appropriate i18n message, so users see "please contact admin" on DB errors
instead of a misleading "wrong password" message. Non-DB errors still
return a unified vague response to avoid leaking user existence.
- Create model/errors.go to centralize all sentinel errors
- ValidateAccessToken now returns error to distinguish DB failures
- ValidateUserToken uses unified ErrTokenInvalid for all auth failures
  (expired/exhausted/disabled/not-found) to prevent token enumeration
- authHelper and TokenAuthReadOnly use i18n messages instead of
  hardcoded Chinese strings
- All err.Error() removed from user-facing responses; DB errors logged
  server-side and return generic "contact admin" message (HTTP 500)
- Migrate ErrRedeemFailed, ErrTwoFANotEnabled to model/errors.go
@mxyhi mxyhi marked this pull request as ready for review April 12, 2026 12:31
@mxyhi mxyhi merged commit 2233a92 into main Apr 12, 2026
1 check passed
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.

2 participants