Skip to content

Conversation

@MODSetter
Copy link
Owner

@MODSetter MODSetter commented Feb 2, 2026

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR refactors the public chat sharing system to use immutable snapshots instead of live threads, implements a heartbeat-based stale task detection system for connector indexing, adds page limit exceeded notifications, and includes various bug fixes for OAuth token refresh, LLM configuration, Discord bot initialization, and Google Calendar date range handling. The snapshot architecture replaces two-phase cloning with single-phase cloning from snapshot data, adds content deduplication via SHA-256 hashing, and embeds podcasts directly in snapshot JSON for self-contained public views. The heartbeat system uses Redis TTL keys (30s interval, 2min timeout) to detect crashed/stuck indexing tasks, preventing perpetual "syncing" indicators. Additional improvements include displaying channel access status for Slack/Discord connectors, better error handling for expired OAuth tokens, LLM configuration validation before file uploads, and various UI/UX enhancements across the frontend.

⏱️ Estimated Review Time: 1-3 hours

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/alembic/versions/85_add_public_chat_snapshots_table.py
2 surfsense_backend/app/db.py
3 surfsense_backend/app/schemas/new_chat.py
4 surfsense_backend/app/services/public_chat_service.py
5 surfsense_backend/app/routes/new_chat_routes.py
6 surfsense_backend/app/routes/public_chat_routes.py
7 surfsense_web/contracts/types/chat-threads.types.ts
8 surfsense_web/contracts/types/public-chat.types.ts
9 surfsense_web/lib/apis/chat-threads-api.service.ts
10 surfsense_web/lib/apis/public-chat-api.service.ts
11 surfsense_web/components/new-chat/chat-share-button.tsx
12 surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx
13 surfsense_backend/app/services/notification_service.py
14 surfsense_backend/app/routes/notifications_routes.py
15 surfsense_backend/app/tasks/celery_tasks/stale_notification_cleanup_task.py
16 surfsense_backend/app/routes/search_source_connectors_routes.py
17 surfsense_backend/app/connectors/composio_gmail_connector.py
18 surfsense_backend/app/connectors/composio_google_calendar_connector.py
19 surfsense_backend/app/connectors/composio_google_drive_connector.py
20 surfsense_backend/app/tasks/connector_indexers/notion_indexer.py
21 surfsense_backend/app/tasks/connector_indexers/slack_indexer.py
22 surfsense_backend/app/tasks/connector_indexers/discord_indexer.py
23 surfsense_backend/app/routes/slack_add_connector_route.py
24 surfsense_backend/app/routes/discord_add_connector_route.py
25 surfsense_web/contracts/types/connector.types.ts
26 surfsense_web/lib/apis/connectors-api.service.ts
27 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/slack-config.tsx
28 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/discord-config.tsx
29 surfsense_backend/app/tasks/celery_tasks/document_tasks.py
30 surfsense_web/components/layout/providers/LayoutDataProvider.tsx
31 surfsense_web/contracts/types/inbox.types.ts
32 surfsense_web/components/layout/ui/sidebar/InboxSidebar.tsx
33 surfsense_backend/alembic/versions/82_add_podcast_status_and_thread.py
34 surfsense_backend/app/connectors/discord_connector.py
35 surfsense_backend/app/connectors/google_calendar_connector.py
36 surfsense_backend/app/connectors/google_drive/credentials.py
37 surfsense_backend/app/routes/airtable_add_connector_route.py
38 surfsense_backend/app/routes/clickup_add_connector_route.py
39 surfsense_backend/app/routes/confluence_add_connector_route.py
40 surfsense_backend/app/routes/jira_add_connector_route.py
41 surfsense_backend/app/routes/linear_add_connector_route.py
42 surfsense_backend/app/routes/notion_add_connector_route.py
43 surfsense_backend/app/routes/teams_add_connector_route.py
44 surfsense_backend/app/agents/new_chat/llm_config.py
45 surfsense_backend/app/services/llm_router_service.py
46 surfsense_backend/app/services/llm_service.py
47 surfsense_backend/app/utils/document_converters.py
48 surfsense_backend/app/routes/podcasts_routes.py
49 surfsense_backend/app/routes/new_llm_config_routes.py
50 surfsense_web/components/assistant-ui/connector-popup.tsx
51 surfsense_web/components/assistant-ui/document-upload-popup.tsx
52 surfsense_web/components/assistant-ui/connector-popup/hooks/use-indexing-connectors.ts
53 surfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view.tsx
54 surfsense_web/lib/format-date.ts
55 surfsense_web/components/tool-ui/generate-podcast.tsx
56 surfsense_web/components/public-chat/public-chat-footer.tsx
57 surfsense_web/components/providers/ElectricProvider.tsx
58 surfsense_web/lib/electric/client.ts
59 surfsense_web/components/layout/ui/sidebar/Sidebar.tsx
60 surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx
61 surfsense_backend/app/celery_app.py
62 surfsense_backend/app/tasks/composio_indexer.py
63 surfsense_backend/app/tasks/connector_indexers/airtable_indexer.py
64 surfsense_backend/app/tasks/connector_indexers/bookstack_indexer.py
65 surfsense_backend/app/tasks/connector_indexers/clickup_indexer.py
66 surfsense_backend/app/tasks/connector_indexers/confluence_indexer.py
67 surfsense_backend/app/tasks/connector_indexers/elasticsearch_indexer.py
68 surfsense_backend/app/tasks/connector_indexers/github_indexer.py
69 surfsense_backend/app/tasks/connector_indexers/google_calendar_indexer.py
70 surfsense_backend/app/tasks/connector_indexers/google_drive_indexer.py
71 surfsense_backend/app/tasks/connector_indexers/google_gmail_indexer.py
72 surfsense_backend/app/tasks/connector_indexers/jira_indexer.py
73 surfsense_backend/app/tasks/connector_indexers/linear_indexer.py
74 surfsense_backend/app/tasks/connector_indexers/luma_indexer.py
75 surfsense_backend/app/tasks/connector_indexers/obsidian_indexer.py
76 surfsense_backend/app/tasks/connector_indexers/teams_indexer.py
77 surfsense_backend/app/tasks/connector_indexers/webcrawler_indexer.py
78 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/date-range-selector.tsx
79 surfsense_web/atoms/chat/chat-thread-mutation.atoms.ts
80 surfsense_web/atoms/chat/current-thread.atom.ts
81 surfsense_web/lib/apis/base-api.service.ts
82 surfsense_web/components/ui/dialog.tsx

Need help? Join our Discord

Analyze latest changes

CREDO23 and others added 30 commits January 29, 2026 16:05
Modify the upgrade function to prevent errors when creating the podcast_status ENUM type by wrapping the creation in a DO block that catches duplicate_object exceptions.
…ce loading behavior for user-specific database
Creates new podcast records for cloned user with thread_id,
updates podcast_id references in message content.
fix(database): handle duplicate podcast_status type creation gracefully
refactor: streamline initialization logic for electric-sql & electric logs will not show in production
…tors

fix: google calendar issues (composio & non-composio)
fix: use ollama_chat provider for proper tool calls support
AnishSarkar22 and others added 21 commits January 31, 2026 18:30
…and implement stale notification cleanup task
- Rename snapshot migration from 84 to 85 to avoid conflict with
  upstream's LLM auto-mode migration
- Remove /api/v1/podcasts/ from noAuthPrefixes since all podcast
  endpoints now require authentication

Co-authored-by: Cursor <cursoragent@cursor.com>
… and update stale notification cleanup logic
…-be-immutable

[Feat] Immutable public chat snapshots
fix: various issues with connectors & other issues
@vercel
Copy link

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
surf-sense-frontend Ready Ready Preview, Comment Feb 2, 2026 5:18am

Request Review

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on d0c1d88..e7c17c3

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (50)

surfsense_backend/alembic/versions/82_add_podcast_status_and_thread.py
surfsense_backend/alembic/versions/85_add_public_chat_snapshots_table.py
surfsense_backend/app/agents/new_chat/llm_config.py
surfsense_backend/app/celery_app.py
surfsense_backend/app/connectors/composio_gmail_connector.py
surfsense_backend/app/connectors/composio_google_calendar_connector.py
surfsense_backend/app/connectors/composio_google_drive_connector.py
surfsense_backend/app/connectors/discord_connector.py
surfsense_backend/app/connectors/google_calendar_connector.py
surfsense_backend/app/connectors/google_drive/credentials.py
surfsense_backend/app/db.py
surfsense_backend/app/routes/airtable_add_connector_route.py
surfsense_backend/app/routes/clickup_add_connector_route.py
surfsense_backend/app/routes/confluence_add_connector_route.py
surfsense_backend/app/routes/discord_add_connector_route.py
surfsense_backend/app/routes/jira_add_connector_route.py
surfsense_backend/app/routes/linear_add_connector_route.py
surfsense_backend/app/routes/new_chat_routes.py
surfsense_backend/app/routes/new_llm_config_routes.py
surfsense_backend/app/routes/notifications_routes.py
surfsense_backend/app/routes/notion_add_connector_route.py
surfsense_backend/app/routes/podcasts_routes.py
surfsense_backend/app/routes/public_chat_routes.py
surfsense_backend/app/routes/search_source_connectors_routes.py
surfsense_backend/app/routes/slack_add_connector_route.py
surfsense_backend/app/routes/teams_add_connector_route.py
surfsense_backend/app/schemas/new_chat.py
surfsense_backend/app/services/llm_router_service.py
surfsense_backend/app/services/llm_service.py
surfsense_backend/app/services/notification_service.py
surfsense_backend/app/services/public_chat_service.py
surfsense_backend/app/tasks/celery_tasks/document_tasks.py
surfsense_backend/app/tasks/celery_tasks/stale_notification_cleanup_task.py
surfsense_backend/app/tasks/composio_indexer.py
surfsense_backend/app/tasks/connector_indexers/airtable_indexer.py
surfsense_backend/app/tasks/connector_indexers/bookstack_indexer.py
surfsense_backend/app/tasks/connector_indexers/clickup_indexer.py
surfsense_backend/app/tasks/connector_indexers/confluence_indexer.py
surfsense_backend/app/tasks/connector_indexers/discord_indexer.py
surfsense_backend/app/tasks/connector_indexers/elasticsearch_indexer.py
surfsense_backend/app/tasks/connector_indexers/github_indexer.py
surfsense_backend/app/tasks/connector_indexers/google_calendar_indexer.py
surfsense_backend/app/tasks/connector_indexers/google_drive_indexer.py
surfsense_backend/app/tasks/connector_indexers/google_gmail_indexer.py
surfsense_backend/app/tasks/connector_indexers/jira_indexer.py
surfsense_backend/app/tasks/connector_indexers/linear_indexer.py
surfsense_backend/app/tasks/connector_indexers/luma_indexer.py
surfsense_backend/app/tasks/connector_indexers/notion_indexer.py
surfsense_backend/app/tasks/connector_indexers/obsidian_indexer.py
surfsense_backend/app/tasks/connector_indexers/slack_indexer.py

⏭️ Files skipped (35)
  Locations  
surfsense_backend/app/tasks/connector_indexers/teams_indexer.py
surfsense_backend/app/tasks/connector_indexers/webcrawler_indexer.py
surfsense_backend/app/utils/document_converters.py
surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx
surfsense_web/atoms/chat/chat-thread-mutation.atoms.ts
surfsense_web/atoms/chat/current-thread.atom.ts
surfsense_web/components/assistant-ui/connector-popup.tsx
surfsense_web/components/assistant-ui/connector-popup/components/date-range-selector.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/discord-config.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/slack-config.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/connector-edit-view.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/views/indexing-configuration-view.tsx
surfsense_web/components/assistant-ui/connector-popup/hooks/use-indexing-connectors.ts
surfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view.tsx
surfsense_web/components/assistant-ui/document-upload-popup.tsx
surfsense_web/components/layout/providers/LayoutDataProvider.tsx
surfsense_web/components/layout/ui/sidebar/InboxSidebar.tsx
surfsense_web/components/layout/ui/sidebar/Sidebar.tsx
surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx
surfsense_web/components/new-chat/chat-share-button.tsx
surfsense_web/components/providers/ElectricProvider.tsx
surfsense_web/components/public-chat/public-chat-footer.tsx
surfsense_web/components/tool-ui/generate-podcast.tsx
surfsense_web/components/ui/dialog.tsx
surfsense_web/contracts/types/chat-threads.types.ts
surfsense_web/contracts/types/connector.types.ts
surfsense_web/contracts/types/inbox.types.ts
surfsense_web/contracts/types/public-chat.types.ts
surfsense_web/lib/apis/base-api.service.ts
surfsense_web/lib/apis/chat-threads-api.service.ts
surfsense_web/lib/apis/connectors-api.service.ts
surfsense_web/lib/apis/public-chat-api.service.ts
surfsense_web/lib/chat/thread-persistence.ts
surfsense_web/lib/electric/client.ts
surfsense_web/lib/format-date.ts

@MODSetter MODSetter merged commit 357035f into main Feb 2, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants