Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR syncs our fork from the previously imported upstream
v0.12.6baseline to the latest official upstream releasev0.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/mainwas still aligned to the earlier upstreamv0.12.6sync. Upstream has since publishedv0.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,
HEADand 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.7release by cherry-picking the four release commits between upstreamv0.12.6andv0.12.7in order:040e8c1dfeat: replace quota input with amount-first UI and atomic quota adjustmented7f8399feat: improve model price error UX with role-aware messages and cleaner UI2819e3a1fix: improve login error handling to distinguish database errors from auth failures59c582d1fix: harden token auth error handling to prevent info leakageThis 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:
.gitignoreKept both the local planning-file ignores and the upstream
token_estimator_test.goignore entry.web/src/components/table/redemptions/modals/EditRedemptionModal.jsxOur fork already adds subscription-plan redemption support, while upstream
v0.12.7introduces amount-first quota input. The final merged result preserves both behaviors:model/redemption.goUpstream moved
ErrRedeemFailedintomodel/errors.goas part of auth/error hardening. The fork-local duplicate definition inmodel/redemption.gowas 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 buildBoth completed successfully.