DM users for Seerr web-UI requests; attribute issues on Seerr 3.4+ - #22
Merged
Merged
Conversation
Requests made outside the bot (in the Seerr web UI) are now adopted into the notification tracker whenever the requester has linked their account, so they get the same availability/decline DMs as bot-submitted requests: - Webhook path: an untracked request id now triggers adoption (fetch the request, map requestedBy -> linked Discord user, track with source 'seerr') instead of being silently ignored. - Poller path: each cycle sweeps GET /request (newest first) down to a persisted high-water-mark cursor. The first sweep is a backfill that adopts already-available/declined requests pre-notified, so enabling the feature records history without a catch-up DM blast. - New persisted toggle (TRACK_EXTERNAL_REQUESTS env + dashboard checkbox under Bot behaviour), on by default. Compatibility layer for the Seerr 3.x API while staying safe on Overseerr/Jellyseerr and pre-3.4 Seerr: - Version detection via GET /status (cached on the client, shown on the Seerr connection card); only universally supported request filters are used, and sortDirection is harmless on older servers. - On Seerr 3.4+, /issue reports are attributed to the reporter's own Seerr account via the new userId field (dropping the "Reported by" message prefix). Pre-3.4 servers silently ignore unknown fields, so the response's createdBy is verified and attribution auto-disables if the server ignored it; older servers keep the exact previous behavior. Closes #17 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Seerr 3.4 validates the userId on POST /issue rather than ignoring it: 404 when the linked account no longer exists, 403 when the API key lacks MANAGE_ISSUES. Either would have made /issue fail outright for a user whose attribution was attempted — worse than the pre-attribution behaviour, which always filed under the API key's owner. SeerrError now carries the HTTP status, and on 403/404 the issue cog refiles without userId using the old "Reported by ..." message. A 403 disables attribution for the session (permissions affect everyone); a 404 stays per-link so other users keep attribution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DM users for Seerr web-UI requests; attribute issues on Seerr 3.4+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes dev to main. Contains #21 (closes #17) plus a follow-up hardening fix:
GET /request. First sweep backfills terminal-state requests pre-notified (no DM blast). NewTRACK_EXTERNAL_REQUESTSenv + persisted dashboard toggle, on by default./issuereports senduserIdso issues land under the reporter's own Seerr account, gated on version detection viaGET /statusand verified against the response'screatedBy. Older Overseerr/Jellyseerr/Seerr servers keep the previous behaviour.userId(404 for a deleted linked account, 403 withoutMANAGE_ISSUES) — on those errors the issue is refiled unattributed with the "Reported by …" message, so a stale link can't break/issue. A 403 disables attribution for the session.sourcecolumn (bot/seerr) totracked_requests.215 tests passing.
🤖 Generated with Claude Code