feat(store): default auto_summarize ON for new users (ADR-018)
Migration 011 flips the auto_summarize column default to TRUE and brings existing rows (maintainer + current registrations) along. Onboarded friends now get zero-friction discovery: scheduled discovery (ADR-018) both discovers AND summarizes new videos, so a user's list fills and summarizes itself instead of presenting an empty list of manual Summarize buttons. Safe only because the process-wide caption-fetch rate gate (ADR-014 item 2, prior commit) now exists — auto + scheduled + multi-user would otherwise self-inflict 429s every cycle. The down migration reverts the default but intentionally leaves existing rows as-is (no surprise manual regression on rollback). RegisterUser already lets the column default drive the value, so no app change is needed; the account-page manual toggle still works. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,27 @@ func TestAutoSummarizeRoundTripDefaultsFalse(t *testing.T) {
|
||||
require.False(t, got, "set back to manual round-trips")
|
||||
}
|
||||
|
||||
func TestRegisteredUserDefaultsAutoSummarizeOn(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
s := newStore(t)
|
||||
resetDB(t, rawPool(t))
|
||||
|
||||
// A real registration creates the users row, so the column default (migration
|
||||
// 011: TRUE) drives the mode — onboarded friends get auto out of the box.
|
||||
id, err := s.RegisterUser(ctx, subjectA, "Alice")
|
||||
require.NoError(t, err)
|
||||
|
||||
got, err := s.GetAutoSummarize(ctx, id)
|
||||
require.NoError(t, err)
|
||||
require.True(t, got, "new registrations default to auto-summarize (ADR-018)")
|
||||
|
||||
// The account-page toggle still works: a user can switch to manual.
|
||||
require.NoError(t, s.SetAutoSummarize(ctx, id, false))
|
||||
got, err = s.GetAutoSummarize(ctx, id)
|
||||
require.NoError(t, err)
|
||||
require.False(t, got, "the manual toggle still flips it off")
|
||||
}
|
||||
|
||||
func TestRequestSummarizeSetsFlag(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
s := newStore(t)
|
||||
|
||||
Reference in New Issue
Block a user