# Recall empty, unsaved buffers on app load \(\#33475\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 12bc8907d926ca719ae182ac3aba0ba7e226f9d7

Requested commit: 12bc8907d926ca719ae182ac3aba0ba7e226f9d7

Commit: 12bc8907d926ca719ae182ac3aba0ba7e226f9d7

Tree: a3a5d14b0b35d4755448bf7287b7bff39b4ef1f0

Author: vipex

Committer: GitHub

## Message

```
Recall empty, unsaved buffers on app load (#33475)

Closes #33342

This PR implements serialization of pinned tabs regardless of their
state (empty, untitled, etc.)

The root cause was that empty untitled tabs were being skipped during
serialization but their pinned state was still being persisted, leading
to a mismatch between the stored pinned count and actual restorable
tabs, this issue lead to a crash which was patched by @JosephTLyons, but
this PR aims to be a proper fix.

**Note**: I'm still evaluating the best approach for this fix. Currently
exploring whether it's necessary to store the pinned state in the
database schema or if there's a simpler solution that doesn't require
schema changes.

--- 

**Edit from Joseph**

We ended up going with altering our recall logic, where we always
restore all editors, even those that are new, empty, and unsaved. This
prevents the crash that #33335 patched because we are no longer skipping
the restoration of pinned editors that have no text and haven't been
saved, throwing off the count dealing with the number of pinned items.

This solution is rather simple, but I think it's fine. We simply just
restore everything the same, no conditional dropping of anything. This
is also consistent with VS Code, which also restores all editors,
regardless of whether or not a new, unsaved buffers have content or not.

https://github.com/zed-industries/zed/tree/alt-solution-for-%2333342

Release Notes:
- N/A

---------

Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
```

## Parents

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

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