[Bug]: Config parse errors, with config.toml lines, are sent to every signed-in user

Open Beginner friendly
#102 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend, security

Research direction

Start at the subscription handler in src/api/events.rs around line 132, where every subscriber receives the event, and follow how me and libraries are threaded into translate. Then read src/config/store.rs around line 356 to see exactly what Event::ConfigError carries. Done means a non-admin receives a plain ConfigChanged with no error text while an admin still sees it, with the admin flag passing cleanly through translate; check the existing events tests for the pattern.

Written by the indexing model from the issue text.

Description

bug

[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.

Version

0.40.0 (feat/desktop, 017a837b)

Area

Config

What happened?

When config.toml changes on disk and fails to parse, the watcher sends Event::ConfigError with the parser's message (src/config/store.rs:356). The events subscription passes it to every subscriber, admin or not (src/api/events.rs:132). toml's error message quotes the offending line, so if that line holds a TMDB key, SMTP password or Torznab API key, every signed-in user receives it.

Steps to reproduce
  1. Sign in as a non-admin in one browser and keep a page open (it subscribes to events).
  2. Break a line containing a secret in config.toml, e.g. api-key = "abc (missing quote).
  3. The non-admin's events subscription gets a ConfigChanged with the line in error.
Expected behavior

Only admins get the error text; everyone else gets a plain ConfigChanged (or nothing).

Suggested fix

Filter Event::ConfigError (and ConfigChanged) by is_admin in translate, which needs the user's admin flag passed in alongside me and libraries.

Dominant language
TypeScript
Stars
4
Forks
1
Avg merge
4h 49m
Merged PRs (30d)
5

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

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 tinystream-dev/tinystream

All issues in tinystream-dev/tinystream

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.