Commit Graph
662 Commits
Author SHA1 Message Date
yibaiba d1db0948f5 fix: harden modem and IMS recovery 2026-09-04 09:05:21 +08:00
yibaiba bd1000cf67 fix(vowifi): order IMS and SMS readiness events 2026-09-04 08:09:04 +08:00
yibaiba 6fd4dc5dc6 fix(vowifi): align IMS recovery with carrier behavior 2026-09-03 22:05:34 +08:00
yibaiba 85023315bb fix(ims): back off port-s recovery per RFC 5626 2026-09-03 20:30:12 +08:00
yibaiba 1c392fd29a fix(volte): keep host off the LTE internet PDN when 网络 is off
Native VoLTE still has the operator default 3gnet bearer for LTE
attach; that cannot be CGACT-deactivated. Hideck must not use it as
usbnet. Always flush/down the data iface when NetworkEnabled is
false, including after IMS PDN comes up.
2026-09-03 20:13:12 +08:00
yibaiba 25a5ef7316 fix(qmi): unstick wedged CTL after SIM swap without CFUN
SIM swap can leave qmi_wwan/qmi-proxy holding a dead cdc-wdm
session while AT still works. Recovery then kept allocating CTL
clients on that wedged port. Prefer AT IMEI during rescan, skip
startup UIM reset when the card is already ready, and if CTL
allocate times out twice with AT alive, USB-reset only that modem.
2026-09-03 19:56:46 +08:00
yibaiba 7383c348a6 fix(qmi): keep StartCore retry and read SIM over AT
QMI DMS allocate timeout after SIM swap was tearing down the worker
because identity refresh only used QMI and recovery treated empty
identity as half-ready. Leave the worker running while StartCore
retries, and read IMSI/ICCID from the AT port so card policy can
apply without a CFUN reboot.
2026-09-03 19:40:08 +08:00
yibaiba 05096f2111 fix(ims): scope port-s recovery to current binding 2026-09-03 19:24:22 +08:00
yibaiba 9e4aa7a77d fix(qmi): rebuild after qmi-proxy pipe break on SIM swap
Modem reboot leaves the proxy socket dead while NAS reconcile stays
in flight, so health checks never reopen QMI. Treat that broken pipe
as transport-down, keep AT VoLTE when IMS client allocate fails, and
fall back to AT+CNUM for the local number.
2026-09-03 19:18:27 +08:00
yibaiba 3b1aa9bf3a fix(vowifi): restore runtime boundary test coverage 2026-09-03 18:21:25 +08:00
yibaiba 8ad2265a13 fix(ims): wait for the protected SMS push flow 2026-09-03 18:21:08 +08:00
yibaiba dc4b173a52 chore(release): 2.1.8 UPX Docker image on Debian
UPX 5 stubs exec on glibc but Alpine/gcompat reports Not a valid
dynamic program. Put the packed binary back and run it on bookworm.
v2.1.8
2026-09-03 15:06:17 +08:00
yibaiba 941f1a6dd0 chore(release): 2.1.7 keep 503 refresh and unpack Docker binaries
Ship the 2degrees 503 keep-binding fix. Stop putting UPX-packed
hideck into the Alpine image; 2.1.6 restarted with Not a valid
dynamic program until the binary was unpacked.
v2.1.7
2026-09-03 14:46:17 +08:00
yibaiba 13d92dd9d3 fix(ims): keep a live binding when a refresh REGISTER gets 503
2degrees answers an already-authenticated re-REGISTER with 503. That
was treated as a pre-auth transport failure, so the working TCP was
closed to try UDP, errors.Join wrapped nil as %!w(<nil>), and the
still-valid Contact was torn down. Initial unauthenticated 503 still
falls back; a 200 recovery REGISTER is unchanged.
2026-09-03 14:42:47 +08:00
yibaiba e945774a5e chore(release): 2.1.6 port-s recover and shutdown binding
Package the IMS fixes on de4005e: recover port-s after a 30s grace,
fail a registration whose outbound refresh detached the flow, and
leave the registrar Contact alone on shutdown.
v2.1.6
2026-09-03 12:58:16 +08:00
yibaibaandCursor de4005e080 fix(ims): leave the registrar binding alone on shutdown
Shutdown removed its Contact binding with a REGISTER Expires=0 and fell back
to Contact:* when that timed out. Measured on 2026-09-03, 3 of 11 shutdown
de-registrations took that fallback, and Contact:* also third-party
de-registers the IP-SM-GW, after which Vodafone stopped pushing MT MESSAGE
even following a clean re-REGISTER. So every restart carried a 27% chance of
breaking MT SMS on purpose.

The binding it removed is not worth that. It expires on its own, the next
registration replaces it, and a leftover one showed up in only 3 of 46
registrations as a second Contact, which is logged and left alone. The
reg-event path that would answer duplicates with a wildcard cannot even run
here: SUBSCRIBE for reg was rejected 489 Bad Event 26 times that day.

Shutdown now ends the event subscriptions and stops there.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 11:56:16 +08:00
yibaibaandCursor 05daedbe0b fix(ims): fail a registration whose flow the outbound refresh detached
The follow-up REGISTER that completes an RFC 5626 outbound binding is
optional, so its failure was swallowed whenever the binding was not
required. That is only safe while the flow it ran over survived, and a
failed attempt can detach the signaling flow on its way out.

Measured on 2026-09-03: a 503 on that REGISTER ran detachDeadSignaling,
which cleared the transport and closed both sockets, yet registration was
still reported successful with an empty transport and protected_tcp false.
No port-s followed, and nothing noticed until three STUN keepalives had
failed 90s later and the runtime rebuilt from scratch — three minutes of
undeliverable MT SMS for one 503 that a re-REGISTER answers in seconds.

Keep the registration only when a usable flow is still attached.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 11:55:50 +08:00
yibaibaandCursor ab01aa01af fix(ims): recover the port-s flow instead of pinging it
port-s is the reverse flow the P-CSCF dials to us and the only path MT SMS
and INVITE can take, while the outbound REGISTER flow keeps looking healthy,
so nothing else reports it gone.

Stop sending CRLF keepalives on it. RFC 5626 4.4.1 gives keepalives to the
client that registered the flow, so this one is the peer's to maintain.
Pinging it anyway drew no pong across 582 writes over 39m and did not stop
the flow from dying; the writes only cost a wakeup and reset our own
keepalive idle timer. Silence is not a signal either: a healthy flow stayed
quiet for a median of 60s and up to 48m across 234 idle windows, so
portSLastReadAt stays as diagnostics and the write counters are gone.

Restore RFC 5626 flow recovery when it closes, with a 30s grace for networks
that reopen it on demand. Vodafone UK never has, measured once over 4m with
an MT SMS queued and once over 12m35s, and 7 of 8 closures needed the
REGISTER to get MT SMS moving again. Networks that dislike the refresh
(2degrees 503) are covered by retiring recovery for good the moment their
REGISTER is rejected, rather than by never recovering anywhere.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 11:55:24 +08:00
yibaiba c63148b0b1 chore(release): 2.1.5 port-s keep-register and SMSC queue
Keep the IMS binding when port-s is closed (#9). Ask the SMSC for its
queue after a rejected report, and log when a message is holding the rest.
v2.1.5
2026-09-03 09:54:03 +08:00
yibaiba c6f01a57fb Merge pull request #9 from Milkmonkey/fix/vowifi-ports-lazy
Keep IMS registration when P-CSCF closes port-s. That TCP is on-demand
downlink; re-REGISTER over port-c 503s on 2degrees and drops SMS.
2026-09-03 09:10:36 +08:00
yibaibaandCursor 288b7424cd fix(ims): say when the SMSC is holding a short message
A rejected report leaves its message at the head of the SMSC queue and
every later one waits behind it. On 2026-09-03 that lasted 53 minutes
and held five messages, and nothing in the logs said so: the redelivered
copies were absorbed by dedup, the rejections looked like isolated
warnings, and the state was only noticed as missing SMS.

A redelivery is the observable sign the queue has not advanced, so
remember the messages whose report was rejected and report it when one
of them comes back, with the rejection count and how long the block has
lasted. The record is dropped when a report finally lands, which is also
the moment the queue is released.

Redeliveries cannot be matched on the existing dedup fingerprint because
it mixes in the RP-MR and the SMSC allocates a fresh one per attempt,
which is why the same message came back looking new three times. Key on
what survives instead: sender, recipient, content and SCTS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 08:41:50 +08:00
yibaibaandCursor 0dd791f805 fix(ims): ask for the queue when a report is rejected
Reinstates the prompt removed in 0b4c440. That removal read two firings
that released nothing as evidence the mechanism was useless, but
neither ran against a blocked queue: one fired after its message had
already been delivered, the other when nothing was waiting.

A run on 2026-09-03 showed what the blocked case costs. One message sat
at the head of the SMSC queue for 53 minutes because its report was
rejected three times, with the retransmission interval growing from
5m20s to 18m40s to 23m43s. Five later messages waited behind it, up to
48 minutes each. When a redelivery was finally acknowledged they all
arrived within six seconds, the last of them seven seconds after its
own SCTS, so delivery was never slow.

Nothing in the request can be corrected: a rejected report diffed
against an accepted one from the same pool leaves only Via, Route,
From tag, Call-ID, In-Reply-To, branch and the Contact GRUU. Retrying
our own report was already tried and reverted. Re-registering does not
make the SMSC retry.

What is left is how often a report gets to be sent, since each has an
independent chance of being accepted. Only a redelivery carries a fresh
Call-ID and so a fresh report, and RP-SMMA is the receiver-initiated
way to ask for one now rather than waiting out the backoff.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 08:37:16 +08:00
yibaiba f3ace29180 chore(release): 2.1.4 navy-light / navy-night theme
Ship the web theme pair from #5 with the 2.1.3 IMS fixes.
v2.1.4
2026-09-02 21:29:38 +08:00
yibaiba f8e55d406f Merge pull request #5 from yibaiba/cursor/navy-theme-pair-f556
feat(web): navy-light / navy-night 主题对,经典暗色保留在设置中
2026-09-02 21:28:05 +08:00
yibaiba 0794053bcb chore(release): 2.1.3 IMS SMS, port-s keepalive, and 2degrees outbound
Document the VoWiFi REGISTER/SMS fixes since 2.1.2 and point install
docs at the new binaries.
v2.1.3
2026-09-02 21:16:27 +08:00
yibaibaandCursor 0b4c440113 revert(ims): stop asking the SMSC to flush its queue
Both prompts rested on the premise that a rejected RP-ACK makes the SMSC
hold later messages behind the unacknowledged one. Measurement refuted
it: report status shows no correlation with the delay of the messages
that follow, and the delays traced to registration blackouts instead.

Observed on the only two firings. The short message had already been
decoded and notified before the prompt went out, and the sole inbound
MESSAGE that followed was the network's report for the prompt itself,
not a released message. An unsolicited MO carries its own cost: it
already produced a defect where we rejected that report with 488.

The TS 24.341 5.3.2.5 path stays, so RP-SMMA still goes out when memory
becomes available after we denied a message, along with the record that
matches the network's report for it.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 20:45:43 +08:00
yibaibaandCursor 28fa5b683e chore: stop tracking the go workspace file
go.mod already replaces the four third_party modules with their local
paths, so GOWORK=off builds cmd/hideck just the same. The workspace file
is local developer setup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 20:30:35 +08:00
yibaibaandCursor 08316364a6 chore: stop tracking go.work.sum
The go command rewrites it whenever the workspace is built, so it kept
getting swept into unrelated commits.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 20:28:48 +08:00
yibaibaandCursor d3746801c5 fix(ims): keep this binding when an earlier one is still listed
A binding left by an earlier run keeps its own Contact URI, and this
network offers no RFC 5626 outbound, so registering again adds to it
instead of replacing it. Clearing it took a wildcard de-registration,
which dropped this registration and its SA too: the next REGISTER was
challenged with new SPIs that could not be installed on client ports
this flow still held, costing a whole extra attempt.

The registrar reaps the dead binding on its own. Measured against a
SIGKILL that leaves no de-registration, the follow-up REGISTER already
reported a single Contact one second later, and an MT short message
arrived, was stored and notified over that registration.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 20:25:01 +08:00
yibaibaandCursor 9f908d7218 fix(ims): abandon an attempt whose IPsec SA was re-issued
A repeat challenge installs new SPIs on the client ports already in use,
so the established flow ran under SPIs the P-CSCF had replaced and the
next REGISTER over it was dropped without any response. The port cannot
be rebound while it drains and the ports are what Security-Client
negotiated, so the attempt gives way to one that offers fresh ports
(TS 33.203 7.4).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 19:55:54 +08:00
yibaibaandCursor b5d8c72f08 fix(ims): retry a REGISTER that never got a final response
The AKA challenge leaves its 401 in the attempt result, so a follow-up
request that timed out was classified from that stale status, rejected as
permanent for 10 minutes and torn down instead of retried. RFC 3261
17.1.2 makes a lost transaction a transport failure. A restart took 8.5
minutes over five rebuilds to recover from this.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 19:55:45 +08:00
yibaibaandCursor ae52a8b867 fix(ims): track inbound activity on the push flow alone
tcp_socket_reads is shared with the registration stream, so it could not
tell whether the flow that carries MT SMS was still receiving anything.
Measuring silence against it showed a healthy flow idling for up to 48m,
which is why silence is only reported, never acted on.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 19:55:35 +08:00
Milkmonkey e07106f805 fix(vowifi): keep registration after portS closure 2026-09-02 18:23:55 +08:00
yibaiba a8064c0b1d Merge pull request #8 from Milkmonkey/fix/vowifi-outbound-supported
Keep the Supported-only skip from #8, and keep the first REGISTER 200
if a non-required outbound follow-up still fails.
2026-09-02 18:00:28 +08:00
yibaiba 09f77f4703 Merge pull request #8 from Milkmonkey/fix/vowifi-outbound-supported
fix(vowifi): only refresh outbound bindings when required
2026-09-02 17:58:29 +08:00
yibaibaandCursor b30d0543a9 fix(ims): report port-s write liveness in the periodic snapshot
The write counters only surfaced when the flow closed or a write failed,
so until the next reset there was no way to tell the instrumentation was
even counting. The inbound snapshot already runs every 30s and covers
the read side of the same flow, so carry the write side there too.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 17:52:07 +08:00
yibaibaandCursor 535d7d6b8b fix(ims): make port-s keepalive liveness visible
The push flow carries MT SMS, yet the only signal that it stopped
working was the peer's RST. CRLF keepalives went out write-only and the
failure branch used RunDebug, which never fires in a release build, so a
flow that had gone dead looked identical to a healthy one.

Count the writes that land and the ones that do not, warn on failure,
and report both plus the age of the last landed write when the flow
closes. A reset that arrives while writes are still landing means the
peer was reachable and tore the flow down; writes that start failing
first mean it became unreachable. Logging only, no protocol change.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 17:46:56 +08:00
yibaibaandCursor daff953be9 fix(ims): ask the SMSC for its queue once port-s recovers
A P-CSCF reset kills whatever MT delivery the network had in flight on
that flow. Shortening the reconnect grace cut the blackout to about six
seconds, but a short message lost inside it still waits for the SMSC's
own retransmission timer, measured at 13 to 30 minutes on Vodafone UK.

RP-SMMA is the receiver-initiated way to ask for that queue now, so send
one when port-s comes back after a drop, reusing the existing one-per-
minute limit. Carriers that never reset the push flow never trigger it.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 16:26:42 +08:00
yibaibaandCursor 43df0091e5 fix(ims): shorten the port-s reconnect grace to 4s
A push-connection reset leaves no path for MT SMS until port-s is back,
and Vodafone drops or defers by ~15min anything it tries to deliver in
that window. Across 30 resets the P-CSCF either reopened port-s within
3s or never did, so the 15s grace never bought a recovery it would have
missed at 4s -- it only tripled the blackout, from a 6s median under the
old immediate re-REGISTER to 20s.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 15:59:25 +08:00
Milkmonkey ee17b202ce fix(vowifi): avoid outbound refresh for Supported-only 2026-09-02 15:29:59 +08:00
yibaibaandCursor c207219603 fix(ims): make the RP-SMMA trace visible in release builds
logging.RunDebug only emits for processes started by go run, so the
RP-SMMA send and the acceptance of its report were invisible in the
deployed binary -- exactly the two events we need to see to tell whether
a prompt completed a clean round trip.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 14:45:17 +08:00
yibaibaandCursor 843ae9a857 fix(ims): accept the network report that acknowledges our RP-SMMA
The network answers RP-SMMA with its own RP-ACK/RP-ERROR MESSAGE
(TS 24.341 5.3.2.5), but that report has no MO part behind it, so
handleInboundRPReport found no submitted SM for its In-Reply-To and
rejected it with 488 -- the mirror image of the failure we are chasing
on the Vodafone side. The path was unreachable while RP-SMMA only fired
on memory-full recovery; now that a rejected delivery report prompts
one, it rejects a report on every prompt.

Track the Call-IDs of RP-SMMA we send and acknowledge their reports
with 200 without touching the delivery store.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 14:18:03 +08:00
yibaibaandCursor abc1175f90 fix(ims): ask the SMSC to flush its queue after a rejected report
When a delivery report is rejected the SMSC still counts the short
message as outstanding and holds everything behind it until its own
retransmission timer fires. Measured on Vodafone UK that wait was 13
to 66 minutes, and messages sent during it were invisible to the user
even though the ones that did arrive were stored within seconds.

RP-SMMA is the only receiver-initiated way to ask for that queue, so
send one after a final rejection instead of waiting. Rate limited to a
minute because a single prompt covers every message in the same flush.

The trigger is a rejected report, not a particular carrier.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 14:01:34 +08:00
yibaibaandCursor b2409ef5a4 fix(ims): log the RP report attempts actually sent
The warning printed rpReportMaxAttempts unconditionally, so a 488 —
final since we let the SMSC own retransmission — was reported as four
attempts when only one request went out. Reading those logs cost real
time while chasing a carrier rejection.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 13:54:39 +08:00
yibaibaandCursor d112ab4216 fix(ims): answer a delivered MT short message with 200, not 202
RFC 3428 reserves 202 for a UAS acting as a message relay that has not
delivered end to end, and tells the sender not to assume delivery when
it sees one. As the SM-over-IP receiver we are the final recipient, so
202 understated what had happened: the short message was already
decoded and stored before the response went out.

TS 24.341 5.3.2.3 defers the MT response to RFC 3428 and never asks the
receiver for 202; every 202 the clause mandates belongs to the
IP-SM-GW answering an SM-over-IP sender.

Vodafone UK rejects roughly a third of our RP-ACK reports with 488, on
requests byte-identical to the ones it accepts, while O2 and EE accept
every one. A gateway told delivery was unconfirmed dropping the
transaction it then cannot correlate is a plausible reading of that.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 13:45:02 +08:00
yibaiba f05145cbcd fix(ims): skip outbound follow-up REGISTER when only Supported
2degrees advertises Supported: outbound without Path;ob or Require.
The extra REGISTER after the 200 then 503s and tore down SMS.

Only complete the outbound binding on Require, Path;ob, or an echoed
reg-id. If that follow-up fails without Require, keep the first 200.
2026-09-02 13:22:58 +08:00
Cursor Agentandyibaiba 48d0378f4f fix(web): lock Element Plus input tokens to 16px, nav chips to 12px
QA still saw runway fields because --el-border-radius-base was 20.
Set EP input/select tokens and wrappers to 16px; keep cards 24 and
primary buttons pill.

Co-authored-by: yibaiba <yibaiba@users.noreply.github.com>
2026-09-02 04:59:56 +00:00
yibaibaandCursor e2ffbccf27 fix(ims): let the SMSC own MT retransmission after a 488 report
Drop the two probes added while chasing Vodafone UK's 488s: the RP
report no longer waits before its first attempt, and 488 is final
again. Neither showed a measurable effect across today's traffic
(four 202s and one 488 without the delay, two 202s and one 488 with
it; four retries spanning 16s were all rejected), so both were
charging every operator a universal cost for one carrier's quirk.

Per 24.341 5.3.3.4.1 a 488 means the IP-SM-GW cannot correlate the
report at all, and the SMSC recovers on its own. Both reports that
failed today were followed by an SMSC retransmission of the short
message 13 and 66 minutes later, each acknowledged on the first
attempt. Recovery is minutes-scale, which is why second-scale
retries never caught it. Messages queued behind a rejected report
drain within a second once the retransmission is acknowledged, and
inbound dedup keeps the retransmission from notifying twice, so the
user-visible cost is delay rather than loss.

The spec-conformant packaging and the wire diagnostics stay.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 12:58:18 +08:00
Cursor Agentandyibaiba ea40a5cd09 fix(web): keep single-line inputs at 16px and sidebar selection at 12px
QA wanted soft fields, not racetrack pills, and a 12px active nav chip.
Cards stay 24px and primary buttons stay pill.

Co-authored-by: yibaiba <yibaiba@users.noreply.github.com>
2026-09-02 04:56:05 +00:00
yibaibaandCursor 7e05c6f0f3 fix(ims): restore spec RP-ACK packaging and probe the 488 report path
The MT delivery report follows RFC 3261 8.1.1.4 and TS 24.341 B.6-7
again: a fresh UAC Call-ID with In-Reply-To carrying the MT Call-ID,
after a body-less 202 to the MT MESSAGE (RFC 3428 7). Reusing the MT
Call-ID to chase IP-SM-GW affinity was non-conformant and did not
stop the 488s anyway.

Vodafone UK answers byte-identical RP-ACKs with 202 and 488 minutes
apart from the same IP-SM-GW instance, so 488 is treated as retryable
and the report is held back briefly to let our 202 land first. Both
are provisional and applied to every operator on purpose: neither has
shown a measurable effect yet, and a carrier-specific branch would be
premature. Redacted header dumps of the report and its final response
make a 202 and a 488 comparable from logs alone.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 11:58:59 +08:00