Skip to content

omamobile-modem-sit 0.3.44: an IMS bearer the network ended no longer blocks the internet bearer's reconnect - #881

Merged
derekross merged 1 commit into
derekross:mainfrom
den-kloot:omamobile-modem-sit-reconnect-ims-record
Nov 18, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
den-kloot:omamobile-modem-sit-reconnect-ims-record

Conversation

@den-kloot

Copy link
Copy Markdown
Contributor

What and why

After the network ended both bearers at once, mobile data stayed down until a reboot, even with the reconnect from 0.3.42 in place.

What happened on a Pixel 9a (27077, at home, not moving), 2026-11-18:

02:25:49 Data-call list changed: no bearers; the internet bearer (CID 1) is gone from the list
02:25:49 Internet bearer dropped by the modem; setting it up again in 3 s
02:25:53 Internet bearer setup again failed: RuntimeError existing target or unresolved bearer ownership (try 1; next in 15 s)
...
08:03:39 Internet bearer setup again failed: RuntimeError existing target or unresolved bearer ownership (try 22; next in 1800 s)

Packet registration stayed home throughout. reconnect() clears the internet bearer's own record, but sitd's IMS record (ims-session.json, CID 2) stayed behind although the modem no longer listed CID 2. activate()'s check calls - modem != owned then refused every try.

reconnect() now also clears an IMS record whose CID is gone from the list. It holds nothing to release, so nothing is sent to the modem for it. A listed IMS bearer keeps its record.

This does not bring IMS back. Calls and SMS still need a reboot after such a drop. I have a follow-up for that on a separate branch, which I'll open once it has seen a real loss on the phone.

Device and build

  • Phone: Pixel 9a (tegu)
  • Kernel release (uname -r): 7.3.0-rc6-omamobile-push1-gbd32edee1132
  • Packages changed, with versions: omamobile-modem-sit 0.3.44 (on main at 0.3.43; please set the number as you need at merge)

Checks (no phone needed)

  • tools/pr-check upstream/main passes
  • tests/all passes: not run. CI will show it.
  • tests/packages passes for the package I touched: packages/omamobile-modem-sit/test/all (scripts parse, unit tests plus RIL against sit-sim, staged layout). There are two new tests in test_data_call_change.py: an IMS record the modem no longer lists is cleared before the setup's ownership check (it fails without the fix), and a listed IMS bearer keeps its record.
  • Each changed package has its version bumped, and the new version is in the commit subject
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone, still in the failed state above: I moved the IMS record aside by hand (which is what the fix does) and left sitd running. Its next scheduled try (08:33:42) logged Internet bearer set up again, omamobile-sit-data brought the cellular route back, and HTTPS over rmnet0 answered 204.
  • The patched service.py has been installed and running since the reboot after that. It hasn't been tested against a fresh drop yet.
  • What I did not test: the patched code catching a new drop by itself. Also not on other phones, but the change is device-independent.
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)

🤖 Generated with Claude Code

… blocks the internet bearer's reconnect

When the network ends both bearers at once (an empty IND_DATA_CALL_LIST_CHANGED), the reconnect (0.3.42) cleared only the internet bearer's record. sitd's IMS record (CID 2) stayed behind, naming a CID the modem no longer listed, so activate()'s ownership check refused every try with "existing target or unresolved bearer ownership". On a Pixel 9a (27077, at home) that kept mobile data down from 02:25 until a reboot six hours later, 22 tries, while the modem stayed registered.

The reconnect now also clears an IMS record whose CID is gone from the list: it holds nothing to release. A listed IMS bearer keeps its record. Checked on the 9a in that state: with the IMS record moved aside by hand, the running sitd's next try set the internet bearer up again (HTTPS over rmnet0 fine).

IMS itself is not brought back by this; calls and SMS still need a reboot after such a drop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a clear find and a careful fix: the log, the one check in activate() that refused, and a change that sends nothing to the modem. I read it against activate() and owned_ids(): with an IMS record whose CID isn't listed, the setup is refused on every phone every time, so your lines only run where the reconnect was already stuck. I also ran your new test against main's service.py and it fails there, as you say. CI is green, so I'm merging it as 0.3.44; #837 touches the same function and will take the next number.

Three things for the follow-up you mention, none of them for this pull request:

  • When your phone next meets such a drop with the fix installed, could you post the journal lines here ("IMS bearer record cleared", "Internet bearer set up again") and what omamobile-sit status says about IMS afterwards? So far the proof is the record moved by hand, which shows the mechanism but not the new lines.
  • Before you write the IMS half, please read omamobile-modem-sit: a second start in the same boot gets data and IMS back #376 (@W4HO-ham's draft): its withdraw_stale() tells the modem's IMS stack the old PDN is gone and registers again, and it registered VoLTE after a restart on a 9a on 3 November. I'd like one way of bringing IMS back, not two.
  • One case to think about there: if the modem lists CID 2 again by itself after we've cleared its record, the next reconnect would be refused again, as a bearer nobody owns. It didn't happen in your six hours, so I don't expect it, but the follow-up should say what it does then.

Your report also corrects something I wrote: the release notes say calls and texts use a separate connection that didn't drop. On your network it dropped together with the data bearer. I'll open an issue for "IMS stays down after the network ends its bearer" so the follow-up has a home.

@derekross
derekross merged commit e34dbff into derekross:main Nov 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants