Skip to content

[Bug]: Mobile: removing a route can remove the whole environment and delete its unsent drafts and queued messages #41820

Done

Description

@juliusmarminge

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile (route removal logic in packages/client-runtime)

What happens

In an environment's Routes list on mobile, Remove is offered on a route whenever the list shows more than one route. A route marked "found automatically" counts towards that, but it borrows the login of the route it was learned through and is removed together with it. When the removed route was the only one with its own login, no route is left, so the app forgets the whole environment and deletes that environment's unsent composer drafts and queued (not yet sent) messages. The confirmation only says "Remove ?" with the route's address.

Steps to reproduce

  1. On a computer, run T3 Code with network access on. Pair the phone with it over one address only (for example its LAN address), with no other route added by hand.
  2. Stay connected until the route list for that environment shows a second route labelled "found automatically" (for example the Tailscale address).
  3. Open a thread in that environment and type a message without sending it. Optionally queue a message while the computer is unreachable.
  4. Open the environment's settings, go to Routes, tap Edit, and tap Remove on the route you paired over. Confirm the "Remove ?" dialog.

The same should happen with a phone that reaches the computer only through T3 Connect plus an automatically found LAN route, when the T3 Connect route is removed.

I have not run this on a device; the steps follow the code on main.

Expected behavior

Removing a route never removes the environment without saying so. Either Remove is not offered when no route would be left afterwards, or the dialog says the environment, its drafts and its queued messages will be deleted.

Actual behavior

The environment disappears from the app and its drafts and queued messages are deleted. Pairing again does not bring them back.

Impact

Data loss (unsent drafts and queued messages)

Version or commit

main @ 6ac6817

Environment

iOS and Android app.

Where

Likely fix: decide whether Remove is offered from routesAfterRemoving instead of the displayed count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions