Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fix(daemon): a superseded daemon overwrites the shared daemon-shutdown.json

Open
#3,104 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

Locate writeDaemonShutdownReport and clearDaemonShutdownReport, then trace readRegisteredDaemonOwnership and the shared state paths they use. Confirm how ownership records are interpreted and update both sites so a daemon proceeds only when ownership is match; done means a superseded daemon cannot overwrite or clear the successor's shutdown report.

Written by the indexing model from the issue text.

Description

Problem

writeDaemonShutdownReport and clearDaemonShutdownReport write and delete daemon-shutdown.json in the shared state dir without checking who owns it, unlike the daemon.json and daemon.lock paths, which now prove ownership first (#3087).

A daemon that has been superseded still runs its own shutdown, so it can:

  • overwrite the successor's shutdown report with its own, or
  • clear a report the successor still needs.

Both hide why a shutdown happened from whoever is debugging the daemon that is actually serving clients.

Why it is separate from #3087

The issue's completion conditions cover daemon.json only. The fence needs the same reasoning applied to a second shared file, and that file has its own readers whose expectations have to be checked, so it does not belong in the #3087 diff.

Direction

Reuse readRegisteredDaemonOwnership at both sites and decline the write when the record is not match. Note that this file is written by the daemon leaving, so the check is "am I still the serving daemon", not "does this file name me".

Refs #3087, #3102

Dominant language
TypeScript
Stars
4.8k
Forks
315
Avg merge
11h 17m
Merged PRs (30d)
536

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from callstack/agent-device

All issues in callstack/agent-device

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.