mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6465] [MERGED] fix(inbounds): allow negative subSortIndex for subscription order #6288
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#6288
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/6465
Author: @mrchatam
Created: 9/11/2026
Status: ✅ Merged
Merged: 9/12/2026
Merged by: @MHSanaei
Base:
main← Head:fix/allow-negative-sub-sort-index📝 Commits (2)
4609572fix(inbounds): allow negative subSortIndex for subscription order8baedcafix(inbounds): gofumpt model.go and trim subSortIndex comments📊 Changes
16 files changed (+116 additions, -52 deletions)
View changed files
📝
docs/public/openapi.json(+1 -2)📝
frontend/public/openapi.json(+1 -2)📝
frontend/src/generated/schemas.ts(+1 -2)📝
frontend/src/generated/zod.ts(+1 -1)📝
frontend/src/lib/xray/inbound-form-adapter.ts(+1 -1)📝
frontend/src/pages/inbounds/form/InboundFormModal.tsx(+1 -1)📝
frontend/src/pages/inbounds/list/InboundList.tsx(+1 -1)📝
frontend/src/schemas/forms/inbound-form.ts(+1 -1)📝
frontend/src/test/inbound-form-adapter.test.ts(+5 -8)📝
internal/database/db.go(+3 -4)📝
internal/database/model/model.go(+1 -1)📝
internal/web/controller/inbound.go(+1 -1)📝
internal/web/service/inbound_sub_sort_test.go(+51 -23)📝
internal/web/service/inbound_subsort_test.go(+24 -0)📝
internal/web/service/inbound_util.go(+3 -4)➕
internal/web/service/inbound_util_test.go(+20 -0)📄 Description
Summary
Fixes #5332
subSortIndexalready drives subscription output order (ORDER BY sub_sort_index ASC), but every layer rejected values below 1, so primary inbounds could not sort first without bumping every other inbound.This change keeps omitted/
0normalizing to1for backward compatibility, while preserving explicitly set negative indices end-to-end (model validation, API binding, service normalize, startup DB lift, form schema/UI, and generated OpenAPI).Test plan
go test ./internal/web/service/ -run 'SubSort|NormalizeSubSort'inbound-form-adaptervitest (including negative preservation)subSortIndexto-1and confirm it sorts ahead of default1in subscription output🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.