Skip to content

[Bug]: Mobile: removing an environment leaves its open thread on screen #46215

Done

Description

@shivamhwp

Area

apps/mobile

Steps to reproduce

  1. Open a thread on the phone.
  2. Open Environments on top of it, expand that thread's environment, and tap Remove environment, then Remove. The prompt says it forgets the environment and its cached threads on this device.
  3. Close Environments.

Expected behavior

The thread is gone from the open screen too: it shows that the thread's environment isn't on this device (the "Environment not added" state), or closes.

Actual behavior

The removed environment's thread stays on screen with its messages and an enabled composer. The only sign is an "Environment is not connected" pill, and the header no longer names the environment. The thread list behind it has already dropped the thread and the environment.

Before removing Environments after Remove Back on the thread
Environment's details with Remove environment Environment gone from the list Thread still showing its messages

Sped up 3×:

mobile-remove-environment-thread-stays.mp4

The thread route shows the thread while useThreadSelection returns a thread for the route (ThreadRouteScreen.tsx#L306). After removal it still returns one, though the list's own state no longer has it. Not traced: which store keeps the thread after EnvironmentRegistry.remove clears the environment's cache.

Impact

Minor bug or occasional failure

Version or commit

main @ 7380d2a. iPhone 18 Pro simulator (iOS 27) running the development client against an isolated dev backend.

Found while reviewing #43846, which doesn't change this path.

Activity

  1. added
    bug
    needs-triage
    on Nov 30, 2026
  2. added
    vouch:trusted
    on Nov 30, 2026
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

    bugneeds-triagevouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions