# Ensure Edit Prediction provider is properly assigned on sign-in \(\#35885\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 315a92091b91b4448b4c95ecf9e3dc3fa1bd7a62

Requested commit: 315a92091b91b4448b4c95ecf9e3dc3fa1bd7a62

Commit: 315a92091b91b4448b4c95ecf9e3dc3fa1bd7a62

Tree: 7fd0aa400dd6c690e4dbdc0233112934d77cc828

Author: Marshall Bowers

Committer: GitHub

## Message

```
Ensure Edit Prediction provider is properly assigned on sign-in (#35885)

This PR fixes an issue where Edit Predictions would not be available in
buffers that were opened when the workspace loaded.

The issue was that there was a race condition between fetching/setting
the authenticated user state and when we assigned the Edit Prediction
provider to buffers that were already opened.

We now wait for the event that we emit when we have successfully loaded
the user in order to assign the Edit Prediction provider, as we'll know
the user has been loaded into the `UserStore` by that point.

Closes https://github.com/zed-industries/zed/issues/35883

Release Notes:

- Fixed an issue where Edit Predictions were not working in buffers that
were open when the workspace initially loaded.

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
```

## Parents

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

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