Skip to content

fix: reload starrs table after addstarr insert so the new app gets its starr_id - #118

Merged
austinwbest merged 1 commit into
Notifiarr:developfrom
bakerboy448:claude/addstarr-stale-starrs
Oct 20, 2026
Merged

austinwbest merged 1 commit into
Notifiarr:developfrom
bakerboy448:claude/addstarr-stale-starrs

Conversation

@bakerboy448

Copy link
Copy Markdown
Collaborator

Problem

POST /api/addstarr for a second (or later) backend stores the new app with an empty starr_id (0 once cast), so its scoped key returns 401 on every request. The first backend works because the starrs table is empty at that point.

Cause

loader.php loads $starrsTable once per request. The addstarr handler inserts the new starr, then calls getAppFromStarrKey() with the table loaded before the insert. It only reloads when the table is empty, so the lookup misses the new row.

Fix

Reload $starrsTable right after addStarrApp(). 3 lines, api/index.php.

Testing

Built from this branch and from develop (f189548); throwaway Sonarr, Radarr and a 2nd Sonarr, fresh /config per scenario, bazarr template.

Scenario develop this branch
Sonarr, then Radarr app 2: starr_id empty, 401 1, 2; both 200
Radarr, then Sonarr app 2: starr_id empty, 401 1, 2; both 200
Sonarr, Radarr, Sonarr2 apps 2-3 empty, 401 1, 2, 3; all 200

…s starr_id

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@austinwbest
austinwbest merged commit 68c12fb into Notifiarr:develop Oct 20, 2026
1 check passed
@bakerboy448
bakerboy448 deleted the claude/addstarr-stale-starrs branch October 22, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants