# fix\(desktop\): stop reading Firefox's leftover lock files as a running browser · pingdotgg/t3code

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

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

Visibility: public

Requested revision: 266ec2a604bd1fbfdd522177b5f392ddc631d467

Requested commit: 266ec2a604bd1fbfdd522177b5f392ddc631d467

Commit: 266ec2a604bd1fbfdd522177b5f392ddc631d467

Tree: 81c359ac7628c6650211eecdf51ca74226e080c3

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(desktop): stop reading Firefox's leftover lock files as a running browser

`isSourceRunning` treated `.parentlock` / `parent.lock` as proof Firefox held
the profile, but Firefox deliberately leaves those on disk after a clean exit
(as a last-used marker) and only releases the OS-level fcntl or handle lock —
so once Firefox had been used, the source reported `browserRunning` forever and
cookie import never proceeded.

Verified against Firefox's nsProfileLock.cpp: only the Linux `lock` symlink
(target `<ip>:[+]<pid>`) is unlinked on exit, so its presence plus a live pid
is the POSIX signal; a dead pid means a crash. Node has no fcntl probe, so
`.parentlock` carries no signal on POSIX. On Windows the held handle denies our
open as `Busy`, which is the signal there.

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

```

## Parents

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

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