Skip to content

DM users for Seerr web-UI requests; attribute issues on Seerr 3.4+ - #22

Merged
vancityactivist merged 3 commits into
mainfrom
dev
Aug 5, 2026
Merged

vancityactivist merged 3 commits into
mainfrom
dev

Conversation

@vancityactivist

Copy link
Copy Markdown
Owner

Promotes dev to main. Contains #21 (closes #17) plus a follow-up hardening fix:

  • External request adoption: requests made in the Seerr web UI are adopted for availability/decline DMs when the requester has linked their account — instantly via webhook, or via the poller's cursor-based sweep of GET /request. First sweep backfills terminal-state requests pre-notified (no DM blast). New TRACK_EXTERNAL_REQUESTS env + persisted dashboard toggle, on by default.
  • Issue attribution (Seerr 3.4+): /issue reports send userId so issues land under the reporter's own Seerr account, gated on version detection via GET /status and verified against the response's createdBy. Older Overseerr/Jellyseerr/Seerr servers keep the previous behaviour.
  • Attribution fallback (9a15f94): Seerr 3.4 validates userId (404 for a deleted linked account, 403 without MANAGE_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.
  • Storage: idempotent migration adds a source column (bot/seerr) to tracked_requests.

215 tests passing.

🤖 Generated with Claude Code

vancityactivist and others added 3 commits August 4, 2026 11:57
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+
@vancityactivist
vancityactivist merged commit ed9ebf8 into main Aug 5, 2026
2 checks passed
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.

Request DMs

1 participant