# Fix race condition between feature flag and deserialization \(\#37381\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ac8c653ae6d784bc2395f8ec3a0674fba5d770a8

Requested commit: ac8c653ae6d784bc2395f8ec3a0674fba5d770a8

Commit: ac8c653ae6d784bc2395f8ec3a0674fba5d770a8

Tree: a7d12fbf2f4779a98d46c2b7bc0be8427ab34b99

Author: Richard Feldman

Committer: GitHub

## Message

```
Fix race condition between feature flag and deserialization (#37381)

Right now if you open Zed, and we deserialize an agent that's behind a
feature flag (e.g. CC), we don't restore it because the feature flag
check hasn't happened yet at the time we're deserializing (due to auth
not having finished yet).

This is a simple fix: assume that if you had serialized it in the first
place, you must have had the feature flag enabled, so go ahead and
reopen it for you.

Release Notes:

- N/A
```

## Parents

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

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