server: a deferred create can still attach during an UNFORCED environment destroy's backend teardown
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 47/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
Research direction
Read the decision doc at docs/decisions/2026-08-destroy-environment-live-sessions.md and the related issue #9509 test that records the current unforced-path behavior. Trace deferred create through SessionManager.createSession and EnvironmentManager.addSession while backend teardown is pending. Add a test that proves the late session is refused or receives session_destroyed, and verify it fails against main.
Written by the indexing model from the issue text.
Description
Context
Split from #9509. Its fix makes a FORCED environment destroy call the cascade's onLiveSessions a second time, after a successful backend teardown and before the environment record is deleted. A session a deferred create attaches during the teardown is then torn down, with session_destroyed, instead of being left on a removed container.
The remaining window
An UNFORCED destroy refuses with ENVIRONMENT_HAS_LIVE_SESSIONS when sessions are attached at lock time, and never hands sessions to onLiveSessions. That refusal is the policy in docs/decisions/2026-08-destroy-environment-live-sessions.md: an unforced destroy has no consent to destroy a session.
A deferred create (for example a user-shell create held for host approval) replays container info it captured earlier and never calls getContainerInfo. If it attaches through SessionManager.createSession → EnvironmentManager.addSession while an unforced destroy is awaiting its backend teardown, the same thing #9509 fixed for the forced path happens here:
- the container is removed and the environment record is deleted;
- the session stays in
SessionManager._sessionson a removed container; - no
session_destroyedis broadcast.
The #9509 test file pins the current behaviour: "the UNFORCED path does not hand attached sessions to onLiveSessions".
The decision needed
Closing this changes what an unforced destroy may do, so it is a policy question for the decision doc, not just an implementation one. Two options:
- Tear the straggler down anyway. Its container is already gone, so the session cannot work either way. Run the same post-teardown
onLiveSessionscall on the unforced path. The refusal at lock time is unchanged. - Refuse the late attach at the deferred replay step. The deferred path re-reads
getContainerInfobefore it attaches. This touches the deferred/host-approval pipeline.
Acceptance
- The decision doc records which option, and why.
- A test drives a deferred attach during an UNFORCED destroy's backend teardown, and shows the session is either refused or torn down with
session_destroyed, never left on the removed container. - The test is proven red against
main.
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 1
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 333
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from blamechris/chroxy
-
from-review tech-debt testing
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
blamechris/chroxy#9520 ·
Maintainers usually reply within 1 day
-
priority: low server
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
blamechris/chroxy#9340 ·
Maintainers usually reply within 1 day
-
documentation from-review
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
blamechris/chroxy#9237 ·
Maintainers usually reply within 1 day
-
agent-control client: notify() docstring should say the outbound gate applies only in principal modeOpenenhancement from-review
Difficulty 1/5 Under an hour Newbie friendliness 80/100
blamechris/chroxy#9227 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
blamechris/chroxy#9108 ·
Maintainers usually reply within 1 day
All issues in blamechris/chroxy
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Use one constant for the 10,000-character input limitPossibly taken @NginxL claimed this today. Opengood first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aniru-dh21/snap-validate#51 ·
Maintainers usually reply within 1 day
-
Documentation pleaseOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area/host bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Fei2411/DeepSeek-Bot#3190 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
freelawproject/litigant-portal#1307 ·
Maintainers usually reply within 2 days