feat: sync deployed v1.0.0-rc.38-custom.42

Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
cneicy committed 2026-09-26 04:49:11 +08:00
1 parent aa6c3f50f4
commit ceddfd3d6b
828 files changed
+122253 -13702

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
package controller
import (
"github.com/stretchr/testify/assert"
"testing"
"time"
)
func TestSuccessfulUserRequestRestoresStatus(t *testing.T) {
now := time.Now().Unix()
for _, tc := range []struct {
name string
success, probe int64
disabled bool
want int
}{
{"fresh user overrides failed probe", now, now - 10, false, 1},
{"newer failed probe wins", now - 10, now, false, 0},
{"expired success", now - 901, now - 1000, false, 0},
{"disabled remains disabled", now, now - 10, true, 0},
} {
t.Run(tc.name, func(t *testing.T) {
m := Monitor{Status: 0, ChannelDisabled: tc.disabled}
applyUserSuccess(&m, tc.success, tc.probe, now)
assert.Equal(t, tc.want, m.Status)
})
}
}