summaryrefslogtreecommitdiff
path: root/supabase/schema.sql
Commit message (Collapse)AuthorAgeFilesLines
* fix: prioritise unread entries server-side so they appear in all-entries viewFuwn2026-02-121-9/+28
|
* feat: add drag-and-drop reordering for feeds, folders, and custom feedsFuwn2026-02-121-0/+53
|
* feat: switch search_entries to trigram-based search with similarity rankingFuwn2026-02-121-7/+18
| | | | | | | Uses pg_trgm % operator instead of ILIKE for title/summary matching, enabling the existing GIN trigram indexes. Results are now ranked by similarity score. Threshold lowered to 0.1 for inclusive matching. Also adds owner_id filter that was previously missing.
* fix: prevent read entries from reverting to unread on re-fetchFuwn2026-02-121-3/+11
| | | | | | | | | | | | | | | | | Root cause: cleanup_stale_entries deleted read-but-unsaved entries from active feeds, then the Go worker re-inserted them with new UUIDs, orphaning the user_entry_states rows and making entries appear unread. - cleanup_stale_entries: skip feeds with active subscribers and preserve entries that have been read (not just saved) - Go parser: normalize GUIDs by trimming whitespace and stripping tracking query parameters from URL-based identifiers - Go writer: preserve original published_at on upsert instead of overwriting, preventing old entries from jumping to timeline top - get_unread_counts: apply same time boundary as get_timeline so ancient re-inserted entries don't inflate counts - Realtime listener: ignore INSERT events for entries older than 48h to suppress misleading "new entries" notifications from re-inserts
* Redump latest Supabase schemaFuwn2026-02-111-33/+42
|
* fix: exclude hidden feeds from total/folder unread counts onlyFuwn2026-02-101-4/+3
| | | | | | Reverts the DB-level filter so individual hidden feeds still show their own unread badge. Filters client-side in totalUnreadCount and getFolderUnreadCount instead.
* fix: exclude hidden feeds from unread countsFuwn2026-02-101-3/+4
| | | | | | get_unread_counts() now filters on hidden_from_timeline = false, so feeds hidden from the timeline no longer inflate the total unread badge or appear in aggregated counts.
* fix: harden CI and close remaining test/security gapsFuwn2026-02-101-2/+35
| | | | | | | | | - Make webhook URL tests deterministic with injectable DNS resolver - Wire tier parity checker into CI and root scripts - Add rate_limits cleanup cron job (hourly, >1hr retention) - Change rate limiter to fail closed on RPC error - Add Go worker tests: parser, SSRF protection, error classification, authentication, and worker pool (48 test functions)
* feat: scoped mark-all-read, share enhancements, notification z-indexFuwn2026-02-101-3/+7
| | | | | | | | | - Mark all as read now scopes to current feed/folder instead of all - Added undo button to mark-all-read toast notification - Share notes can be toggled between public and private visibility - Track share view count and display in shares list - Activity-based share expiry: views reset the expiry timer - Fixed notification panel z-index layering behind content area
* refactor: use Supabase Auth display name instead of custom columnFuwn2026-02-101-5/+4
| | | | | | Migrate existing display names from user_profiles to auth.users user_metadata. Drop display_name column from user_profiles. Frontend now reads from auth user metadata and updates via auth.updateUser().
* fix: resolve Supabase security and performance advisoriesFuwn2026-02-091-955/+3396
| | | | | | Enable RLS on rate_limits table (accessed only via SECURITY DEFINER). Fix api_keys delete policy to use (select auth.uid()) subquery to avoid per-row re-evaluation. Refresh schema dump from live database.
* fix: P0 correctness and security fixesFuwn2026-02-091-1/+45
| | | | | | - Add missing 'developer' case to check_custom_feed_limit trigger (was falling through to else 1) - Scope user_entry_states join to authenticated user in /api/v1/entries (admin client bypasses RLS) - Replace in-memory rate limiting with Supabase-backed solution (UNLOGGED table + check_rate_limit RPC + pg_cron cleanup)
* feat: add per-feed "hide from timeline" optionFuwn2026-02-091-0/+3
|
* security: harden database functions and policiesFuwn2026-02-081-15/+31
| | | | | | | | | | | | - Add SET search_path TO '' on 4 SECURITY DEFINER functions (update_feed_url, check_subscription_limit, check_folder_limit, check_muted_keyword_limit) to prevent search path injection - Add DELETE policy to api_keys table for GDPR compliance - Escape ILIKE/LIKE wildcards (%, _, \) in search_entries and get_custom_feed_timeline RPCs to prevent wildcard injection - Fix get_custom_feed_timeline missing developer tier in retention check (was only checking 'pro', developer users got 14-day limit) - Fully qualify table references in update_feed_url
* feat: share with highlighted excerpt and fix auth redirect URLsFuwn2026-02-081-1/+6
| | | | | | | | | Add "share" button to text selection toolbar so users can share an entry with a highlighted passage visible to visitors. The public share page renders the highlight and scrolls to it on load. Also fix magic link and password reset redirects to use NEXT_PUBLIC_APP_URL instead of window.location.origin so emails link to the production domain.
* feat: add feed management features and fix subscribe_to_feed bugsFuwn2026-02-081-46/+90
| | | | | | | | | | | | | - Fix subscribe_to_feed overload ambiguity by dropping old 4-param version - Fix vault permission error by using vault.create_secret instead of direct INSERT - Add duplicate subscription check with clear error message - Add unmute confirmation dialog matching unsubscribe pattern - Add feed button in subscriptions settings page - Add inline rename for feeds, folders, and custom feeds from reader header - Add drag and drop feeds between folders in sidebar - Add credential management UI (add/update) for pro/developer tier - Add add_feed_credentials RPC to convert public feeds to authenticated - Enable pgsodium extension for vault crypto operations
* chore: update schema dump with authenticated feed trigger changes and new ↵Fuwn2026-02-081-5/+144
| | | | functions
* chore: dump full supabase schema for local referenceFuwn2026-02-071-0/+995
All tables, indexes, RLS policies, functions, triggers, and pg_cron jobs extracted from live instance. Removed empty functions/ and migrations/ scaffolding directories.