A newly connected account showed no videos until the next 2h scheduled pass — the gap that made onboarding look broken (a second user connected, saw nothing, read as failure). The connect callback now fires an out-of-band discovery pass for the connecting user, so videos appear promptly. Concurrency: scheduled and connect-triggered passes share one lock (serialize), preserving the single-fetcher invariant (ADR-018). A trigger interleaves between the scheduler's per-user passes rather than fetching concurrently or waiting for a whole pass. The trigger runs on the server ctx (survives the redirect) and is non-blocking for the request goroutine. Scope: connect-trigger only. The optional login-refresh / "Discover now" button from #6 are intentionally not built — an unconditional login hook risks 429 storms (per the ticket's own recommendation); defer until wanted. TDD: TestCallbackTriggersDiscovery, TestSerializeRunsOneAtATime, TestDiscoveryTriggerEnqueueRunsUser; new BDD scenario mapped. Refs #6 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
55 lines
2.2 KiB
Gherkin
55 lines
2.2 KiB
Gherkin
Feature: Connect and manage video accounts
|
|
As a user
|
|
I want to connect my YouTube or Vimeo account and have my subscriptions tracked
|
|
So that Tapir watches the channels I already follow
|
|
|
|
Scenario: Connect a YouTube account
|
|
Given I have no connected video accounts
|
|
When I connect my YouTube account
|
|
Then the connection is stored with status "active"
|
|
And my refresh token is stored only as a secret reference
|
|
And my subscriptions are synced
|
|
|
|
@pending
|
|
# Vimeo connect is not built yet (provider label exists; no connect flow or test).
|
|
Scenario: Connect a Vimeo account
|
|
Given I have no connected video accounts
|
|
When I connect my Vimeo account
|
|
Then the connection is stored with status "active"
|
|
And my subscriptions are synced
|
|
|
|
Scenario: Connecting an account discovers videos immediately
|
|
Given I have no connected video accounts
|
|
When I connect my YouTube account
|
|
Then a discovery pass for my account is triggered right away
|
|
And I do not have to wait for the next scheduled pass to see my videos
|
|
|
|
Scenario: Tokens are never stored in the clear
|
|
When I connect any video account
|
|
Then no OAuth token value is stored in the database
|
|
And only an opaque secret reference is stored
|
|
|
|
Scenario: Revoking a connection stops watching but keeps history
|
|
Given I have a connected YouTube account with summaries
|
|
When I revoke the connection
|
|
Then the connection status becomes "revoked"
|
|
And no new videos are watched for that connection
|
|
And my existing summaries remain readable
|
|
|
|
@pending
|
|
# Per-provider BYO credential config is not built as a web flow yet (the summarizer
|
|
# supports a fallback endpoint, but there is no user-facing BYO setup + its test).
|
|
Scenario Outline: BYO AI credential is optional and per-provider
|
|
When I configure a BYO provider "<provider>"
|
|
Then the credential is stored only as a secret reference
|
|
And it is used only as the fallback when local AI fails
|
|
|
|
Examples:
|
|
| provider |
|
|
| anthropic |
|
|
| openai |
|
|
| gemini |
|
|
|
|
# Stage 1 (Future B): connecting a new user's account requires no code change.
|
|
# Isolation: a user can only ever see and manage their own connections.
|