mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-17 15:47:14 +00:00
fix(inbounds): allow negative subSortIndex for subscription order (#6465)
* fix(inbounds): allow negative subSortIndex for subscription order Preserve explicitly set negative indices so primary inbounds can sort ahead of the default without renumbering peers; keep 0/omitted → 1. * fix(inbounds): gofumpt model.go and trim subSortIndex comments --------- Co-authored-by: mrchatam <287639636+mrchatam@users.noreply.github.com>
This commit is contained in:
@@ -9,11 +9,10 @@ import "strings"
|
||||
// installs (>32k clients) where even modern SQLite would refuse a single IN.
|
||||
const sqliteMaxVars = 900
|
||||
|
||||
// normalizeSubSortIndex clamps the 1-based subscription sort order. Values
|
||||
// below 1 arrive from clients that predate the field (omitted form key binds
|
||||
// to 0) and must not sort ahead of explicitly ranked inbounds.
|
||||
// normalizeSubSortIndex maps omitted/zero to 1; explicit negatives are kept
|
||||
// so a primary inbound can sort ahead of the default.
|
||||
func normalizeSubSortIndex(v int) int {
|
||||
if v < 1 {
|
||||
if v == 0 {
|
||||
return 1
|
||||
}
|
||||
return v
|
||||
|
||||
Reference in New Issue
Block a user