-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: bug fixes #764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: bug fixes #764
Conversation
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
…ate only in development environment
Creates new podcast records for cloned user with thread_id, updates podcast_id references in message content.
… query parameter handling
…rate same-day queries
…roved user context
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
…for multiple connectors
… and update UI to display channels
…in connector views
…and implement stale notification cleanup task
…d initialization handling
…s in connector popup
…chats-should-be-immutable
- 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
…ve security compliance
…-be-immutable [Feat] Immutable public chat snapshots
fix: various issues with connectors & other issues
…g in the notification system
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this 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 |
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
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
surfsense_backend/alembic/versions/85_add_public_chat_snapshots_table.pysurfsense_backend/app/db.pysurfsense_backend/app/schemas/new_chat.pysurfsense_backend/app/services/public_chat_service.pysurfsense_backend/app/routes/new_chat_routes.pysurfsense_backend/app/routes/public_chat_routes.pysurfsense_web/contracts/types/chat-threads.types.tssurfsense_web/contracts/types/public-chat.types.tssurfsense_web/lib/apis/chat-threads-api.service.tssurfsense_web/lib/apis/public-chat-api.service.tssurfsense_web/components/new-chat/chat-share-button.tsxsurfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsxsurfsense_backend/app/services/notification_service.pysurfsense_backend/app/routes/notifications_routes.pysurfsense_backend/app/tasks/celery_tasks/stale_notification_cleanup_task.pysurfsense_backend/app/routes/search_source_connectors_routes.pysurfsense_backend/app/connectors/composio_gmail_connector.pysurfsense_backend/app/connectors/composio_google_calendar_connector.pysurfsense_backend/app/connectors/composio_google_drive_connector.pysurfsense_backend/app/tasks/connector_indexers/notion_indexer.pysurfsense_backend/app/tasks/connector_indexers/slack_indexer.pysurfsense_backend/app/tasks/connector_indexers/discord_indexer.pysurfsense_backend/app/routes/slack_add_connector_route.pysurfsense_backend/app/routes/discord_add_connector_route.pysurfsense_web/contracts/types/connector.types.tssurfsense_web/lib/apis/connectors-api.service.tssurfsense_web/components/assistant-ui/connector-popup/connector-configs/components/slack-config.tsxsurfsense_web/components/assistant-ui/connector-popup/connector-configs/components/discord-config.tsxsurfsense_backend/app/tasks/celery_tasks/document_tasks.pysurfsense_web/components/layout/providers/LayoutDataProvider.tsxsurfsense_web/contracts/types/inbox.types.tssurfsense_web/components/layout/ui/sidebar/InboxSidebar.tsxsurfsense_backend/alembic/versions/82_add_podcast_status_and_thread.pysurfsense_backend/app/connectors/discord_connector.pysurfsense_backend/app/connectors/google_calendar_connector.pysurfsense_backend/app/connectors/google_drive/credentials.pysurfsense_backend/app/routes/airtable_add_connector_route.pysurfsense_backend/app/routes/clickup_add_connector_route.pysurfsense_backend/app/routes/confluence_add_connector_route.pysurfsense_backend/app/routes/jira_add_connector_route.pysurfsense_backend/app/routes/linear_add_connector_route.pysurfsense_backend/app/routes/notion_add_connector_route.pysurfsense_backend/app/routes/teams_add_connector_route.pysurfsense_backend/app/agents/new_chat/llm_config.pysurfsense_backend/app/services/llm_router_service.pysurfsense_backend/app/services/llm_service.pysurfsense_backend/app/utils/document_converters.pysurfsense_backend/app/routes/podcasts_routes.pysurfsense_backend/app/routes/new_llm_config_routes.pysurfsense_web/components/assistant-ui/connector-popup.tsxsurfsense_web/components/assistant-ui/document-upload-popup.tsxsurfsense_web/components/assistant-ui/connector-popup/hooks/use-indexing-connectors.tssurfsense_web/components/assistant-ui/connector-popup/views/connector-accounts-list-view.tsxsurfsense_web/lib/format-date.tssurfsense_web/components/tool-ui/generate-podcast.tsxsurfsense_web/components/public-chat/public-chat-footer.tsxsurfsense_web/components/providers/ElectricProvider.tsxsurfsense_web/lib/electric/client.tssurfsense_web/components/layout/ui/sidebar/Sidebar.tsxsurfsense_web/components/layout/ui/sidebar/SidebarSection.tsxsurfsense_backend/app/celery_app.pysurfsense_backend/app/tasks/composio_indexer.pysurfsense_backend/app/tasks/connector_indexers/airtable_indexer.pysurfsense_backend/app/tasks/connector_indexers/bookstack_indexer.pysurfsense_backend/app/tasks/connector_indexers/clickup_indexer.pysurfsense_backend/app/tasks/connector_indexers/confluence_indexer.pysurfsense_backend/app/tasks/connector_indexers/elasticsearch_indexer.pysurfsense_backend/app/tasks/connector_indexers/github_indexer.pysurfsense_backend/app/tasks/connector_indexers/google_calendar_indexer.pysurfsense_backend/app/tasks/connector_indexers/google_drive_indexer.pysurfsense_backend/app/tasks/connector_indexers/google_gmail_indexer.pysurfsense_backend/app/tasks/connector_indexers/jira_indexer.pysurfsense_backend/app/tasks/connector_indexers/linear_indexer.pysurfsense_backend/app/tasks/connector_indexers/luma_indexer.pysurfsense_backend/app/tasks/connector_indexers/obsidian_indexer.pysurfsense_backend/app/tasks/connector_indexers/teams_indexer.pysurfsense_backend/app/tasks/connector_indexers/webcrawler_indexer.pysurfsense_web/components/assistant-ui/connector-popup/connector-configs/components/date-range-selector.tsxsurfsense_web/atoms/chat/chat-thread-mutation.atoms.tssurfsense_web/atoms/chat/current-thread.atom.tssurfsense_web/lib/apis/base-api.service.tssurfsense_web/components/ui/dialog.tsx