mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6502] [MERGED] fix(clients): preserve traffic reset schedule when toggling enable #6312
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6312
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6502
Author: @alireza4682
Created: 9/13/2026
Status: ✅ Merged
Merged: 9/13/2026
Merged by: @MHSanaei
Base:
main← Head:fix/client-toggle-traffic-reset📝 Commits (1)
ffb2278fix(clients): preserve traffic reset schedule when toggling enable📊 Changes
2 files changed (+54 additions, -0 deletions)
View changed files
📝
frontend/src/hooks/useClients.ts(+2 -0)➕
frontend/src/test/client-toggle-traffic-reset.test.tsx(+52 -0)📄 Description
Summary
Preserve
trafficResetandtrafficResetDayfrom the hydrated client when toggling its enabled state in the clients list.Why
The toggle builds a replacement update payload but omits these two fields.
ClientService.Updatenormalizes the absent cycle tonever, so toggling a client configured for monthly resets on day 15 silently removes its schedule. Both enable and disable now retain that schedule.Type of change
Areas affected
How was this tested?
npm test -- --project unit --project components: 120 files / 1,383 tests passed.npm run lint,npm run typecheck,npm run build, and formatting checks for the changed files passed.make test-gopassed on macOS with local socket access enabled. This does not cover the environment-gated PostgreSQL, Xray E2E, or scale tests.make verifygate has not passed. Storybook browser testing is blocked locally: downloading Chromium returns a location-based HTTP 403, and the installed-Chrome fallback exits during launch. Keeping this PR as draft pending complete verification.Breaking changes
None.
Checklist
go build ./...and the full test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.