user_feed_state
Overview
The user_feed_state table tracks each user's feed consumption state. It records when they last checked their feed and their current feed mode preference. This supports the slow-feed pacing system that prevents infinite scrolling and content addiction.
Relevant Invariants
- Invariant #2: "Calm Is the Default State" -- Feed state enables paced content delivery
- Invariant #8: "Feed Is a View, Not a Goal" -- Feed mode and pacing prevent reward-loop behavior
- Invariant #12: "Slowness Is Baked In" -- Batched loading and session-bounded views
Schema
-- Pre-existing table (inferred from frontend code)
CREATE TABLE user_feed_state (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
user_id UUID REFERENCES auth.users(id) NOT NULL UNIQUE,
last_checked_at TIMESTAMPTZ DEFAULT NOW(),
feed_mode TEXT DEFAULT 'calm',
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | No | uuid_generate_v4() | Primary key |
user_id | uuid | No | -- | User this state belongs to (unique) |
last_checked_at | timestamptz | No | NOW() | When user last viewed their feed |
feed_mode | text | No | 'calm' | Current feed mode preference |
created_at | timestamptz | No | NOW() | Row creation timestamp |
updated_at | timestamptz | No | NOW() | Last update timestamp |
RLS Policies
-- SELECT: Users can read their own feed state
CREATE POLICY "Users can view own feed state"
ON user_feed_state FOR SELECT
USING (auth.uid() = user_id);
-- INSERT/UPDATE: Users can manage their own feed state
CREATE POLICY "Users can upsert own feed state"
ON user_feed_state FOR ALL
USING (auth.uid() = user_id);
Related
- profiles -- User whose feed state this tracks
- circle_feed_state -- Per-circle variant of feed pacing
Last updated: 2026-02-07