# refactor\(desktop\): put browser cookie import on Effect services · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/5a96f50b38ab7c98898f081e8f1ba693ae16c7bb)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 5a96f50b38ab7c98898f081e8f1ba693ae16c7bb

Requested commit: 5a96f50b38ab7c98898f081e8f1ba693ae16c7bb

Commit: 5a96f50b38ab7c98898f081e8f1ba693ae16c7bb

Tree: 8e083cff177f5a0c9a3efc9cd15426984cba137d

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
refactor(desktop): put browser cookie import on Effect services

The import module reached for `node:fs/promises`, `node:os`, `node:path` and
`node:sqlite` directly and threaded results through hand-rolled promises, which
meant a blanket `nodeBuiltinImport:off` on two files and failures that were
plain thrown `Error`s.

It now uses FileSystem, Path and the shared Effect SQL client, and the cookie
snapshot is a scoped resource rather than a try/finally with a cleanup
callback. `node:crypto` stays — it implements the OSCrypt primitives Chromium
uses and has no Effect equivalent — with the suppression narrowed to it and a
reason attached.

Failure reasons are a typed union in contracts rather than free strings, so the
renderer maps a reason to copy instead of substring-matching an error message.

Porting `isSourceRunning` to `FileSystem.stat` reintroduced the dangling
SingletonLock bug, because `stat` and `exists` both follow symlinks; `readLink`
is the probe that answers for the entry itself. The regression test caught it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

```

## Parents

- [043fab0bfc0d2c29185f6daf0f54214efcb570c3](https://git.cafe/pingdotgg/t3code/commit/043fab0bfc0d2c29185f6daf0f54214efcb570c3?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/5a96f50b38ab7c98898f081e8f1ba693ae16c7bb?format=markdown)
