# debugger: Send initialized event from fake server at a more realistic time \(\#35446\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7c169fc9b50a53d0b78f4ad1d14c1bb747ae5ca4)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7c169fc9b50a53d0b78f4ad1d14c1bb747ae5ca4

Requested commit: 7c169fc9b50a53d0b78f4ad1d14c1bb747ae5ca4

Commit: 7c169fc9b50a53d0b78f4ad1d14c1bb747ae5ca4

Tree: e165775022e845e447e221d07dcd1eb9c81cdc08

Author: Cole Miller

Committer: GitHub

## Message

```
debugger: Send initialized event from fake server at a more realistic time (#35446)

The spec says:

> :arrow_left: Initialized Event
> This event indicates that the debug adapter is ready to accept
configuration requests (e.g. setBreakpoints, setExceptionBreakpoints).
>
> A debug adapter is expected to send this event when it is ready to
accept configuration requests (but not before the initialize request has
finished).

Previously in tests, `intercept_debug_sessions` was just spawning off a
background task to send the event after setting up the client, so the
event wasn't actually synchronized with the flow of messages in the way
the spec says it should be. This PR makes it so that the `FakeTransport`
injects the event right after a successful response to the initialize
request, and doesn't send it otherwise.

Release Notes:

- N/A
```

## Parents

- [2b36d4ec94e1013bff014adfae1110e1d7824651](https://git.cafe/gitcafe/zed/commit/2b36d4ec94e1013bff014adfae1110e1d7824651?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7c169fc9b50a53d0b78f4ad1d14c1bb747ae5ca4?format=markdown)
