Commit graph

2681 commits

Author SHA1 Message Date
Anish Sarkar
4658130bb8 feat(editor): update editor limits and add error boundary
- Reduced maximum document size for the editor from 5MB to 1MB.
- Introduced a new line limit of 5000 for documents in the editor.
- Implemented a PlateErrorBoundary component to handle rendering errors gracefully in the editor panel.
- Updated logic in the editor panel to check both size and line count for document limits.
2026-06-17 12:11:31 +05:30
DESKTOP-RTLN3BA\$punk
b9702b3245 chore: linting 2026-06-16 16:27:16 -07:00
DESKTOP-RTLN3BA\$punk
da64433439 fix(db): reap orphaned idle-in-transaction sessions on the Celery engine
The long-running ingestion/podcast/video tasks run on a separate Celery
engine (NullPool), so the web engine's idle_in_transaction_session_timeout
did not cover them — which is exactly where the original 11h zombie
(INSERT INTO chunks) came from. Apply the same protection to the Celery
engine with a generous 60-minute default so a worker that hangs/crashes
mid-transaction can't hold locks on documents/chunks indefinitely, while
never reaping a legitimate per-document embed window.

- config + .env.example: DB_CELERY_IDLE_IN_TX_TIMEOUT_MS (default 3600000).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 16:26:04 -07:00
DESKTOP-RTLN3BA\$punk
89cc3b37ee fix(db): prevent boot-time index DDL from hanging FastAPI startup
A single abandoned "idle in transaction" session held locks on the
documents table, which blocked the non-concurrent CREATE INDEX (hnsw)
run inside the FastAPI lifespan. Each API restart queued another
CREATE INDEX behind an advisory lock, leaving the server stuck at
"Waiting for application startup." indefinitely and freezing ingestion
writes.

Changes:
- setup_indexes(): build every index with CREATE INDEX CONCURRENTLY
  (non-blocking ShareUpdateExclusiveLock) under a per-session
  lock_timeout, and make each statement non-fatal so a contended/slow
  build is retried next boot instead of wedging startup. Drop leftover
  invalid indexes before rebuilding.
- create_db_and_tables(): apply lock_timeout to extension/create_all
  DDL and gate the whole bootstrap behind DB_BOOTSTRAP_ON_STARTUP.
- engine: set idle_in_transaction_session_timeout (asyncpg) so an
  abandoned transaction is reaped automatically.
- config + .env.example: DB_BOOTSTRAP_ON_STARTUP, DB_DDL_LOCK_TIMEOUT_MS,
  DB_IDLE_IN_TX_TIMEOUT_MS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 16:18:49 -07:00
CREDO23
7584312712 style(podcasts): fix ruff issues in podcast spec schema
Remove duplicate typing import and format legacy minute coercion guard.
2026-06-16 23:57:36 +02:00
CREDO23
7a415b61ea test: align QuotaInsufficientError fixtures with balance_micros API
Billable calls now raise quota errors with balance_micros instead of
used_micros/limit_micros; update mocks so CI passes on main.
2026-06-16 23:56:11 +02:00
CREDO23
fd96c930bf test(podcasts): cover seconds duration and legacy minute specs 2026-06-16 23:38:28 +02:00
CREDO23
f997b6464e test(podcasts): update renderer test for second-based duration 2026-06-16 23:38:28 +02:00
CREDO23
cb70b64a70 test(podcasts): update unit fixtures for second-based duration 2026-06-16 23:38:28 +02:00
CREDO23
38991c7db8 test(podcasts): update integration fixtures for second-based duration 2026-06-16 23:38:28 +02:00
CREDO23
16d226e5ce refactor(podcasts): plan transcript length from midpoint seconds 2026-06-16 23:38:28 +02:00
CREDO23
116c38feac refactor(podcasts): build DurationTarget from brief seconds config 2026-06-16 23:38:28 +02:00
CREDO23
af08e2f033 refactor(podcasts): propose brief with min_seconds and max_seconds 2026-06-16 23:38:28 +02:00
CREDO23
d0ed5b94d9 refactor(podcasts): use shared second-based brief duration defaults 2026-06-16 23:38:28 +02:00
CREDO23
845653cbac feat(podcasts): pass min_seconds and max_seconds when proposing brief 2026-06-16 23:38:27 +02:00
CREDO23
085442ed9a feat(podcasts): use seconds defaults on create podcast request 2026-06-16 23:38:27 +02:00
CREDO23
32e0d21604 feat(podcasts): store brief duration in seconds with legacy load 2026-06-16 23:38:27 +02:00
CREDO23
9583e8f250 feat(podcasts): add shared duration limit constants 2026-06-16 23:38:27 +02:00
CREDO23
1048d0afc3 test(podcasts): cover public stream missing-object 404 2026-06-16 20:09:08 +02:00
CREDO23
810ded2dde test(podcasts): cover in-flight 409 and missing-object 404 2026-06-16 20:09:08 +02:00
CREDO23
86a8833fb4 test(podcasts): add exists to fake storage backend 2026-06-16 20:09:08 +02:00
CREDO23
1d70af4684 fix(podcasts): guard public stream against missing audio 2026-06-16 20:09:08 +02:00
CREDO23
0c2808640a fix(podcasts): guard stream against missing audio 2026-06-16 20:09:08 +02:00
CREDO23
d2558e546e feat(podcasts): add audio_exists storage helper 2026-06-16 20:09:08 +02:00
DESKTOP-RTLN3BA\$punk
c855be8ccd fix(auto_reload): update task to use a lambda for user_id in async call 2026-06-11 16:51:18 -07:00
DESKTOP-RTLN3BA\$punk
cff721aa42 feat(migration): evolve podcast lifecycle by detaching from zero_publication and updating column handling 2026-06-11 16:17:14 -07:00
DESKTOP-RTLN3BA\$punk
f166a532bd feat(version): bumped to 0.0.28 2026-06-11 15:59:44 -07:00
DESKTOP-RTLN3BA\$punk
05190da0a9 chore: linting 2026-06-11 15:31:43 -07:00
CREDO23
7b30a76856 fix(gitignore): anchor data/ rule; track podcast voice catalogs 2026-06-12 00:06:37 +02:00
CREDO23
41f4a58663 Merge remote-tracking branch 'upstream/dev' into improvement-podcast-graph
# Conflicts:
#	surfsense_backend/app/tasks/celery_tasks/podcast_tasks.py
2026-06-11 23:14:49 +02:00
DESKTOP-RTLN3BA\$punk
c3695e7837 feat: update auto-reload settings and enhance payment session creation
- Added currency parameter to the Stripe checkout session for auto-reload setup.
- Integrated AutoReloadSettings component into the BuyMorePage for improved user experience.
- Removed deprecated AutoReloadSettings component from user settings directory.
- Updated import paths for AutoReloadSettings in purchases page to reflect new structure.
2026-06-11 13:29:40 -07:00
CREDO23
ca9b157676 fix(podcasts): keep legacy episodes readable and guard regenerate 2026-06-11 12:43:07 +02:00
CREDO23
aa7f14d94f feat(podcasts): add revert-regeneration and surface cancel on the live card 2026-06-11 12:31:42 +02:00
CREDO23
f0fc660d70 feat(podcasts): constrain monologue briefs to a single speaker 2026-06-11 11:56:57 +02:00
CREDO23
eb56acc407 refactor(podcasts): regenerate via brief gate, render brief inline in chat 2026-06-11 11:45:17 +02:00
CREDO23
11a6b178a0 refactor(podcasts): drop transcript gate, add regenerate-from-ready and voice previews 2026-06-11 10:42:13 +02:00
DESKTOP-RTLN3BA\$punk
65e511f77b feat: enhance credit management and user experience
- Updated database queries to check for column existence with schema context.
- Modified credit purchase quantity limits to allow up to 10,000 credits.
- Improved user interface for credit purchases, enabling custom amounts and clamping input values.
- Adjusted FAQ content to clarify credit purchasing process.
2026-06-10 22:52:27 -07:00
CREDO23
c84525897b test(podcasts): relocate stateful tests to integration
Move the lifecycle service, Celery task bodies, and mark_failed coverage out of
DB-faking unit tests and into integration tests against a real Postgres, faking
only true externals (broker, object store, TTS, ffmpeg, billing, LLM). Add HTTP
slices for cancel, voices, scoping, and public-chat streaming. The unit tier is
now fake-free pure logic with no session doubles.
2026-06-11 06:27:00 +02:00
DESKTOP-RTLN3BA\$punk
a7407502d3 feat(refactor): refactor payment system to implement unified credit wallet.
- Updated environment variables and - configurations for credit purchases via Stripe, replacing legacy page pack system.
- Introduced auto-reload feature for credit top-ups and modified database models to track credit transactions.
- Updated notification system to handle insufficient credits and auto-reload failures.
- Adjusted API routes and schemas to reflect changes in credit management.
2026-06-10 16:49:03 -07:00
CREDO23
8f38737ad9 test(podcasts): retarget celery and observability tests to new tasks 2026-06-10 21:45:04 +02:00
CREDO23
97ab7a88fd refactor(podcasts): remove legacy podcaster agent, task, and schema 2026-06-10 21:45:04 +02:00
CREDO23
003d1d2b95 refactor(podcasts): stream public podcast audio via storage backend 2026-06-10 21:44:57 +02:00
CREDO23
8b52cd0ac9 refactor(podcasts): mount lifecycle router, drop legacy routes 2026-06-10 21:44:57 +02:00
CREDO23
3eb7cdb2d8 refactor(podcasts): gate chat-triggered podcast on brief review 2026-06-10 21:44:50 +02:00
CREDO23
b7604167d8 docs(podcasts): tighten comments and docstrings 2026-06-10 20:51:59 +02:00
CREDO23
bae59140a6 refactor(podcasts): propose brief inline at create 2026-06-10 20:51:51 +02:00
CREDO23
aa7aa81c16 refactor(podcasts): drop language detection from brief 2026-06-10 20:51:38 +02:00
CREDO23
15e44616f3 test(podcasts): cover drafting billing gate 2026-06-10 18:44:26 +02:00
CREDO23
0bed4a0d38 test(podcasts): cover failure recording 2026-06-10 18:44:25 +02:00
CREDO23
0c7987cd9e test(podcasts): cover api read model 2026-06-10 18:44:25 +02:00