Skip to content

fix: 修复兑换码额度精度损失(#6680) - #6685

Merged
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
lihu-001:redemption_code
Aug 7, 2026
Merged

fix: 修复兑换码额度精度损失(#6680)#6685
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
lihu-001:redemption_code

Conversation

@lihu-001

@lihu-001 lihu-001 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ 提交说明 / PR Notice

Important

  • 修复兑换码新增与编辑页面额度精度损失问题

📝 变更描述 / Description

将新增与编辑页面的额度数值采用与列表额度一致的小数位处理

🚀 变更类型 / Type of change

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

image

Summary by CodeRabbit

  • Bug Fixes

    • Improved redemption code editing with correctly formatted quota amounts and input increments.
    • Prevented failed or outdated redemption data from overwriting the current form.
    • Improved numeric parsing and preserved quota values when unrelated fields change.
  • Improvements

    • Added loading and saving states that prevent incomplete submissions.
    • Currency and quota values now use consistent precision and formatting.
    • Added support for token-based quota input formatting.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The change centralizes currency precision, adds editable quota conversion utilities, and updates redemption form loading, submission, and input handling. The drawer now reports load errors, blocks invalid submissions, and ignores stale responses. Tests cover precision and asynchronous record changes.

Changes

Redemption quota precision

Layer / File(s) Summary
Currency precision and quota conversion
web/src/lib/currency.ts, web/src/lib/format.ts, web/src/features/redemption-codes/lib/redemption-form.ts
Shared fraction-digit logic converts API quota units into editable amounts and selects the correct input step.
Redemption drawer loading and submission
web/src/features/redemption-codes/components/redemptions-mutate-drawer.tsx
The drawer tracks fresh data, handles failed or stale loads, preserves unchanged quota values, disables busy forms, and shows loading or saving states.
Drawer behavior coverage
web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx
Tests cover CNY precision, load failures, quota recalculation, preserved values, and stale responses after record changes.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Poem

A rabbit checks the quota field,
And sees the proper value yield.
Stale replies are turned away,
While loading states guide the day.
Precise hops keep forms in play.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题明确描述了修复兑换码额度精度损失这一主要变更,并包含关联问题编号。
Linked Issues check ✅ Passed 变更通过统一额度转换和精度处理修复编辑页数值失真,并增加相关表单测试,满足问题 #6680 的目标。
Out of Scope Changes check ✅ Passed 所有变更均围绕兑换码额度精度、表单数据加载和相关测试展开,未发现明显无关代码。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/features/redemption-codes/components/redemptions-mutate-drawer.tsx`:
- Around line 98-104: Update the redemption-loading flow around getRedemption
and the update form so failed or unsuccessful loads set an error state, invoke
handleServerError, and display an i18n-backed toast.error. Track loading and
load-error state, disable or close the form until fresh data loads successfully,
and only allow updateRedemption submission after form.reset has completed with
current redemption data.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 79517e87-9a10-4914-a4a3-d9f425966ad6

📥 Commits

Reviewing files that changed from the base of the PR and between 0ab0202 and 78dd397.

📒 Files selected for processing (4)
  • web/src/features/redemption-codes/components/redemptions-mutate-drawer.tsx
  • web/src/features/redemption-codes/lib/redemption-form.ts
  • web/src/lib/currency.ts
  • web/src/lib/format.ts

Comment thread web/src/features/redemption-codes/components/redemptions-mutate-drawer.tsx Outdated
@Calcium-Ion
Calcium-Ion merged commit e926e5c into QuantumNous:main Aug 7, 2026
1 check was pending

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx (3)

294-347: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for the loading accessibility state.

The drawer now sets aria-busy on the form and disables the surrounding fieldset while it loads. No test asserts either attribute. Add a case that holds the getRedemption promise pending, then asserts aria-busy="true" on #redemption-form and asserts that the quota input is disabled. The existing deferred helper at Line 131 supports this.

As per coding guidelines, "涉及可访问性的组件测试必须覆盖可访问名称、键盘操作,以及 aria-expandedaria-selectedaria-disabledaria-invalid 等状态属性".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx`
around lines 294 - 347, Add a loading-state test near the existing redemption
drawer tests using the shared deferred helper to keep getRedemption pending;
after rendering, assert `#redemption-form` has aria-busy="true" and the quota
input is disabled, then resolve the promise and allow cleanup.

Source: Coding guidelines


187-212: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

waitForCondition only re-evaluates on DOM mutations.

Lines 366, 388, and 434 wait for updates.length === 1, which is a plain array mutation. The MutationObserver never fires for that change. These tests pass only because the initial check at Line 191 is already true, or because an unrelated toast render triggers the observer. The coupling is implicit and will produce a 1500 ms timeout if the success toast is removed.

Await the recorded request directly instead. For example, resolve a deferred inside the put mock and await that promise.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx`
around lines 187 - 212, Replace the DOM-mutation-based waitForCondition usage
for request-count assertions in the affected tests with explicit deferred
promises resolved by the mocked put request. Update the put mock to resolve the
corresponding deferred when the request is recorded, and await that promise
before asserting updates or success behavior; avoid relying on toast or other
DOM mutations for synchronization.

276-288: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reset useSystemConfigStore in afterEach.

renderDrawer changes useSystemConfigStore.getState().setConfig(...) at line 163, and the teardown does not restore the store. Add a reset in teardown before later tests read system-config-storage, such as useSystemConfigStore.setConfig({ currency: {...} }).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx`
around lines 276 - 288, Update the afterEach teardown for the redemptions drawer
tests to reset useSystemConfigStore after renderDrawer may mutate it via
setConfig. Restore the store to its default currency configuration before
subsequent tests access system-config-storage, while preserving the existing
cleanup steps.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx`:
- Around line 19-115: Replace the custom DOM and react-dom harness in the
redemptions-mutate-drawer test with React Testing Library: use render, screen
queries, userEvent interactions, and waitFor for async assertions. Remove the
manual Window global setup, createRoot/act usage, and related MutationObserver
or DOM value management, while preserving the existing test behavior. Add
`@testing-library/react` and `@testing-library/user-event` as development
dependencies.

---

Nitpick comments:
In
`@web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx`:
- Around line 294-347: Add a loading-state test near the existing redemption
drawer tests using the shared deferred helper to keep getRedemption pending;
after rendering, assert `#redemption-form` has aria-busy="true" and the quota
input is disabled, then resolve the promise and allow cleanup.
- Around line 187-212: Replace the DOM-mutation-based waitForCondition usage for
request-count assertions in the affected tests with explicit deferred promises
resolved by the mocked put request. Update the put mock to resolve the
corresponding deferred when the request is recorded, and await that promise
before asserting updates or success behavior; avoid relying on toast or other
DOM mutations for synchronization.
- Around line 276-288: Update the afterEach teardown for the redemptions drawer
tests to reset useSystemConfigStore after renderDrawer may mutate it via
setConfig. Restore the store to its default currency configuration before
subsequent tests access system-config-storage, while preserving the existing
cleanup steps.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a865c51-6f21-4943-b778-ba0edcd43179

📥 Commits

Reviewing files that changed from the base of the PR and between 78dd397 and b0053b7.

📒 Files selected for processing (2)
  • web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx
  • web/src/features/redemption-codes/components/redemptions-mutate-drawer.tsx

Comment on lines +19 to +115
import assert from 'node:assert/strict'

import { Window } from 'happy-dom'

import type { Redemption } from '../../types'

// Use Bun's runner at runtime while reusing the Node test types installed here.
const bunTestModule = 'bun:test'
const { afterAll, afterEach, test } = (await import(bunTestModule)) as {
afterAll: typeof import('node:test').after
afterEach: typeof import('node:test').afterEach
test: typeof import('node:test').test
}

const domWindow = new Window()
const domGlobals = [
'window',
'document',
'navigator',
'HTMLElement',
'HTMLButtonElement',
'HTMLInputElement',
'HTMLFormElement',
'HTMLLabelElement',
'HTMLFieldSetElement',
'SVGElement',
'Node',
'Element',
'Event',
'KeyboardEvent',
'PointerEvent',
'MouseEvent',
'FocusEvent',
'CustomEvent',
'MutationObserver',
'ResizeObserver',
'requestAnimationFrame',
'cancelAnimationFrame',
'getComputedStyle',
] as const

for (const key of domGlobals) {
Object.defineProperty(globalThis, key, {
configurable: true,
value: domWindow[key],
})
}

const { act } = await import('react')
const { createRoot } = await import('react-dom/client')
const i18n = (await import('i18next')).default
const { I18nextProvider, initReactI18next } = await import('react-i18next')
const { Toaster, toast } = await import('sonner')
const { api } = await import('@/lib/api')
const { useSystemConfigStore } = await import('@/stores/system-config-store')
const { RedemptionsProvider } = await import('../redemptions-provider')
const { RedemptionsMutateDrawer } = await import('../redemptions-mutate-drawer')

await i18n.use(initReactI18next).init({
lng: 'en',
resources: {
en: {
translation: {
'Failed to load': 'Failed to load',
'Loading...': 'Loading...',
'Save changes': 'Save changes',
'Something went wrong!': 'Something went wrong!',
},
},
},
})

const reactTestGlobals = globalThis as typeof globalThis & {
IS_REACT_ACT_ENVIRONMENT?: boolean
}
reactTestGlobals.IS_REACT_ACT_ENVIRONMENT = true

type ApiMethod = (url: string, data?: unknown) => Promise<{ data: unknown }>
type MockableApi = {
get: ApiMethod
put: ApiMethod
}
type RenderedDrawer = {
host: HTMLDivElement
root: ReturnType<typeof createRoot>
}
type CurrencyFixture = {
quotaDisplayType: 'USD' | 'CNY'
usdExchangeRate: number
}

const apiClient = api as unknown as MockableApi
const originalGet = apiClient.get
const originalPut = apiClient.put
const originalConsoleLog = Reflect.get(console, 'log')
let renderedDrawer: RenderedDrawer | null = null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether React Testing Library is already available and how other tests are written.
fd -t f 'package.json' web -d 2 --exec cat {} \; | jq '{deps: .dependencies, dev: .devDependencies}'
fd -t d '__tests__' web/src | head -20
rg -n --iglob '*.test.tsx' -e '`@testing-library/react`' -e 'createRoot' web/src -C1

Repository: QuantumNous/new-api

Length of output: 13610


Use React Testing Library for this component test.

This test builds a custom DOM harness and manually controls react-dom/client, MutationObserver, labels, and value updates. Follow the component test guideline by using @testing-library/react plus @testing-library/user-event: add them as dev deps and replace the manual setup with render, screen.*, userEvent, and waitFor.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@web/src/features/redemption-codes/components/__tests__/redemptions-mutate-drawer.test.tsx`
around lines 19 - 115, Replace the custom DOM and react-dom harness in the
redemptions-mutate-drawer test with React Testing Library: use render, screen
queries, userEvent interactions, and waitFor for async assertions. Remove the
manual Window global setup, createRoot/act usage, and related MutationObserver
or DOM value management, while preserving the existing test behavior. Add
`@testing-library/react` and `@testing-library/user-event` as development
dependencies.

Source: Coding guidelines

@lihu-001
lihu-001 deleted the redemption_code branch August 7, 2026 09:19
yiranxiaohui added a commit to yiranxiaohui/new-api that referenced this pull request Aug 7, 2026
Brings in from QuantumNous/new-api:
- fix: 修复兑换码额度精度损失 (QuantumNous#6685)
- feat(rate-limit): user critical rate limit for access token and aff transfer routes
- fix: test Claude/Gemini endpoints with native request format (QuantumNous#6698)
- feat(channels): refine fetched model categorization (QuantumNous#6632)
- security: atomic access-token rotation and aff updates (merge commit from fork)
- refactor(relay): move replay metadata onto request bodies
- fix(relay): set Request.GetBody for transparent HTTP/2 retry (QuantumNous#6249)
- Feat/auto group (QuantumNous#6590)
- fix(aws): cancel Bedrock requests on client disconnect (QuantumNous#6589)

Conflicts resolved:
- controller/model.go: adopt upstream's unified group-model loop with
  FormatMatchingModelName token-limit matching; keep fork's
  hiddenMappedModels filter inside the loop
- model/user.go: keep fork's BatchDeleteUsers; adopt upstream's atomic
  gorm.Expr-based inviteUser
- relay/channel/task/sora/adaptor_test.go: keep both fork's New API
  Video channel tests and upstream's replayable-body test

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ZteapnbTWdP52n7wZ6NsN
0401lucky pushed a commit to 0401lucky/new-api that referenced this pull request Aug 7, 2026
* fix: 修复兑换码额度精度损失(QuantumNous#6680)

* fix(redemption): guard update data integrity
0401lucky added a commit to 0401lucky/new-api that referenced this pull request Aug 7, 2026
- fix(relay): set Request.GetBody so HTTP/2 can transparently retry after upstream stream reset (QuantumNous#6249)
- refactor(relay): move replay metadata onto request bodies (适配 fork: 保留 types.PriceData)
- feat(channels): refine fetched model categorization (QuantumNous#6632)
- fix: test Claude/Gemini endpoints with native request format (QuantumNous#6698)
- feat(rate-limit): add user critical rate limit middleware (access-token / aff-transfer 路由)
- fix: 修复兑换码额度精度损失 (QuantumNous#6685) (保留 fork 随机额度/下载/100000 批量特性)

跳过: relaykit 模块重构系列(86ac0f7 等, 按 fork 策略), GitCode 发布 CI 工作流, 已同步的 24 个 cherry-pick 副本
latioswang added a commit to trycortexai/new-api that referenced this pull request Aug 10, 2026
* fix(relay): set Request.GetBody so the HTTP/2 transport can transparently retry after an upstream stream reset (QuantumNous#6249)

* fix(relay): set Request.GetBody so the HTTP/2 transport can transparently retry after an upstream stream reset

The outbound request body is a type-erased io.Reader over BodyStorage, so
net/http cannot derive Request.GetBody (it only does so for *bytes.Reader,
*bytes.Buffer and *strings.Reader). With GetBody nil, the HTTP/2 transport
cannot transparently retry a request once the body has been written and the
upstream resets the stream with a retryable error (REFUSED_STREAM, or a
connection-level GOAWAY); the relay request then fails with:

    http2: Transport: cannot retry err [...] after Request.Body was written;
    define Request.GetBody to avoid this error

This affects every relay path that goes through DoApiRequest (chat, claude,
gemini, responses, embedding, image, rerank).

BodyStorage (memory and disk) already implements io.Seeker, so replay support
only needed wiring:

- NewOutboundJSONBody additionally returns a getBody that rewinds the storage
  and hands out a fresh non-closing reader. The transport only calls GetBody
  after the previous attempt's body has been abandoned, so the rewind cannot
  race an in-flight read.
- RelayInfo carries it in the new UpstreamRequestGetBody field, set alongside
  UpstreamRequestBodySize by the handlers that build storage-backed bodies.
- applyUpstreamGetBody (symmetric with applyUpstreamContentLength) wires it
  into DoApiRequest/DoFormRequest/DoTaskApiRequest, only when req.GetBody is
  still nil.

Also remove the hand-rolled GetBody override in DoTaskApiRequest: it returned
the same already-consumed reader, so any transport-level replay would have
silently sent an empty body, and it clobbered the correct snapshot-based
GetBody that net/http derives from the *bytes.Reader bodies the task adaptors
pass in. For non-replayable bodies GetBody now stays nil, so a retry fails
loudly instead of corrupting the request.

Covered by unit tests plus an end-to-end raw-frame HTTP/2 test that resets
the first stream with REFUSED_STREAM after the body is written and asserts
the transport transparently retries with the complete body.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(relay): hand out independent readers from GetBody (address review)

Per the http.Request.GetBody contract ("returns a new copy of Body"),
each call must yield a reader with its own cursor. The previous
implementation rewound and reused the shared BodyStorage, so two
consecutive GetBody readers would interfere with each other, and a
replay could disturb the primary body's offset under extreme transport
timing (e.g. attempt N's body write not yet fully abandoned when the
transport builds attempt N+1).

Instead of snapshotting the payload (an extra copy), add
BodyStorage.NewReader, which returns an independent zero-copy reader:

- memory mode: a fresh bytes.Reader over the same immutable backing
  array;
- disk mode: a separate file descriptor over the cache file, so the
  transport closing a replayed body only closes that descriptor.

NewOutboundJSONBody's getBody now simply hands out storage.NewReader,
and once the handler releases the storage, GetBody fails with
ErrStorageClosed instead of replaying stale data.

Tests: interleaved reads across two replay readers and the primary
body each observe exactly their own byte stream, for both the memory
and the disk-backed storage; the existing GetBody and HTTP/2 retry
suites still pass (h2 e2e tests flake-free with -count=20).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(relay): bind replayable metadata on pass-through requests

* fix(relay): reset upstream body metadata between channels

* test(relay): cover replay across retries and channel attempts

* fix(relay): stop following upstream redirects

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* refactor(relay): move replay metadata onto request bodies

* Merge commit from fork

* feat(channels): refine fetched model categorization (QuantumNous#6632)

* feat(channels): refine fetched model categorization

* fix: channel category

* fix: hy3 category

* fix: test Claude/Gemini endpoints with native request format (QuantumNous#6698)

* feat(rate-limit): add user critical rate limit middleware for access token and aff transfer routes

* fix: 修复兑换码额度精度损失 (QuantumNous#6685)

* fix: 修复兑换码额度精度损失(QuantumNous#6680)

* fix(redemption): guard update data integrity

* CI: enhance release synchronization workflow with optional file syncing

* fix(ali): stop injecting top_p into requests that omit it (QuantumNous#6674)

* fix(channels): classify Qwen TTS models correctly (QuantumNous#6711)

* feat(channels): add auto-disable-only channel test mode (QuantumNous#6728)

* perf(web): debounce server and large-list searches (QuantumNous#6727)

* fix: record reasoning effort consistently in usage logs (QuantumNous#6641)

* feat(relay): expose user and group context to parameter overrides (QuantumNous#6534)

* fix(ollama): preserve reasoning and tool-call context (QuantumNous#6605)

* fix: backend length validation (QuantumNous#5548)

* feat(billing): highlight matched conditional multipliers in logs (QuantumNous#6561)

* feat(billing): highlight matched conditional multipliers in usage logs

* fix(billing): make request rule tracing stable and type-safe

* fix(web): require confirmation before rotating access token (QuantumNous#6749)

---------

Co-authored-by: Lucas <hepo.lucas@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: CaIon <i@caion.me>
Co-authored-by: RedwindA <128586631+RedwindA@users.noreply.github.com>
Co-authored-by: Seefs <40468931+seefs001@users.noreply.github.com>
Co-authored-by: lihu-001 <lihu9048@gmail.com>
Co-authored-by: ENCHIGO <38551565+ENCHIGO@users.noreply.github.com>
2hot4you pushed a commit to 2hot4you/new-api that referenced this pull request Aug 13, 2026
* fix: 修复兑换码额度精度损失(QuantumNous#6680)

* fix(redemption): guard update data integrity

(cherry picked from commit e926e5c)
yuqiyi pushed a commit to yuqiyi/new-api that referenced this pull request Aug 16, 2026
* v1.0.0-rc.24: (117 commits)
  CI: enhance release synchronization workflow with optional file syncing
  fix: 修复兑换码额度精度损失 (QuantumNous#6685)
  feat(rate-limit): add user critical rate limit middleware for access token and aff transfer routes
  fix: test Claude/Gemini endpoints with native request format (QuantumNous#6698)
  feat(channels): refine fetched model categorization (QuantumNous#6632)
  Merge commit from fork
  refactor(relay): move replay metadata onto request bodies
  fix(relay): set Request.GetBody so the HTTP/2 transport can transparently retry after an upstream stream reset (QuantumNous#6249)
  Feat/auto group (QuantumNous#6590)
  fix(aws): cancel Bedrock requests on client disconnect (QuantumNous#6589)
  fix(billing): harden tiered retry group-switch billing (QuantumNous#6570)
  fix(billing): settle tiered retries with final group (QuantumNous#6518)
  feat: deepseek responses api (QuantumNous#6562)
  style: use text-sm for public header nav links to match other nav components (QuantumNous#6557)
  fix(oauth): stop treating a foreign window.opener as a bind flow (QuantumNous#6425)
  fix(relay): preserve multipart image edits for New API channels (QuantumNous#6559)
  feat(logs): expose stream status to log owners (QuantumNous#6558)
  feat: support zstd request decompression (QuantumNous#6545)
  fix: preserve Qwen thinking_budget passthrough (QuantumNous#5836)
  feat(oidc): 支持自定义 OIDC 登录显示名称 (QuantumNous#6012)
  ...

# Conflicts:
#	service/text_quota.go
#	web/src/features/models/components/drawers/model-mutate-drawer.tsx
#	web/src/features/pricing/components/model-details.tsx
#	web/src/features/pricing/lib/price.ts
VincentTang86 added a commit to VincentTang86/new-api that referenced this pull request Aug 17, 2026
Both arrived from upstream unformatted — api-key-group-cell.tsx in
0ab0202 (Feat/auto group QuantumNous#6590) and redemption-form.ts in e926e5c
(兑换码额度精度损失 QuantumNous#6685) — and both fail for the same reason: a call and
an import were split across lines that fit inside the 80-column
printWidth, so oxfmt joins them back. Whitespace only, no semantics.

Upstream CI does not run a format gate, so files can land there
unformatted; expect to redo this occasionally after a sync. Kept separate
from the guide.html reflow, which is far larger and unrelated.
DayFliggy pushed a commit to DayFliggy/Ren2Hub that referenced this pull request Aug 17, 2026
* fix: 修复兑换码额度精度损失(QuantumNous#6680)

* fix(redemption): guard update data integrity
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
* fix: 修复兑换码额度精度损失(QuantumNous#6680)

* fix(redemption): guard update data integrity
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.

兑换码编辑页额度精度损失

3 participants