chore: linting

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2025-11-03 16:00:58 -08:00
parent 050581ba6a
commit a3a5b13f48
17 changed files with 104 additions and 69 deletions

View file

@ -66,12 +66,12 @@ class NotionHistoryConnector:
while has_more:
if cursor:
search_params["start_cursor"] = cursor
search_results = await self.notion.search(**search_params)
pages.extend(search_results["results"])
has_more = search_results.get("has_more", False)
if has_more:
cursor = search_results.get("next_cursor")

View file

@ -389,10 +389,12 @@ async def index_airtable_records(
logger.info(
f"Successfully indexed new Airtable record {summary_content}"
)
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Airtable records processed so far")
logger.info(
f"Committing batch: {documents_indexed} Airtable records processed so far"
)
await session.commit()
except Exception as e:
@ -414,7 +416,9 @@ async def index_airtable_records(
)
# Final commit for any remaining documents not yet committed in batches
logger.info(f"Final commit: Total {documents_indexed} Airtable records processed")
logger.info(
f"Final commit: Total {documents_indexed} Airtable records processed"
)
await session.commit()
logger.info(
"Successfully committed all Airtable document changes to database"

View file

@ -353,10 +353,12 @@ async def index_clickup_tasks(
session.add(document)
documents_indexed += 1
logger.info(f"Successfully indexed new task {task_name}")
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} ClickUp tasks processed so far")
logger.info(
f"Committing batch: {documents_indexed} ClickUp tasks processed so far"
)
await session.commit()
except Exception as e:

View file

@ -367,10 +367,12 @@ async def index_confluence_pages(
session.add(document)
documents_indexed += 1
logger.info(f"Successfully indexed new page {page_title}")
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Confluence pages processed so far")
logger.info(
f"Committing batch: {documents_indexed} Confluence pages processed so far"
)
await session.commit()
except Exception as e:
@ -390,7 +392,9 @@ async def index_confluence_pages(
await update_connector_last_indexed(session, connector, update_last_indexed)
# Final commit for any remaining documents not yet committed in batches
logger.info(f"Final commit: Total {documents_indexed} Confluence pages processed")
logger.info(
f"Final commit: Total {documents_indexed} Confluence pages processed"
)
await session.commit()
logger.info(
"Successfully committed all Confluence document changes to database"

View file

@ -461,10 +461,12 @@ async def index_discord_messages(
logger.info(
f"Successfully indexed new channel {guild_name}#{channel_name} with {len(formatted_messages)} messages"
)
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Discord channels processed so far")
logger.info(
f"Committing batch: {documents_indexed} Discord channels processed so far"
)
await session.commit()
except Exception as e:
@ -482,7 +484,9 @@ async def index_discord_messages(
await update_connector_last_indexed(session, connector, update_last_indexed)
# Final commit for any remaining documents not yet committed in batches
logger.info(f"Final commit: Total {documents_indexed} Discord channels processed")
logger.info(
f"Final commit: Total {documents_indexed} Discord channels processed"
)
await session.commit()
# Prepare result message

View file

@ -380,10 +380,12 @@ async def index_github_repos(
)
session.add(document)
documents_processed += 1
# Batch commit every 10 documents
if documents_processed % 10 == 0:
logger.info(f"Committing batch: {documents_processed} GitHub files processed so far")
logger.info(
f"Committing batch: {documents_processed} GitHub files processed so far"
)
await session.commit()
except Exception as repo_err:

View file

@ -406,10 +406,12 @@ async def index_google_calendar_events(
session.add(document)
documents_indexed += 1
logger.info(f"Successfully indexed new event {event_summary}")
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Google Calendar events processed so far")
logger.info(
f"Committing batch: {documents_indexed} Google Calendar events processed so far"
)
await session.commit()
except Exception as e:
@ -428,7 +430,9 @@ async def index_google_calendar_events(
await update_connector_last_indexed(session, connector, update_last_indexed)
# Final commit for any remaining documents not yet committed in batches
logger.info(f"Final commit: Total {documents_indexed} Google Calendar events processed")
logger.info(
f"Final commit: Total {documents_indexed} Google Calendar events processed"
)
await session.commit()
await task_logger.log_task_success(

View file

@ -323,10 +323,12 @@ async def index_google_gmail_messages(
session.add(document)
documents_indexed += 1
logger.info(f"Successfully indexed new email {summary_content}")
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Gmail messages processed so far")
logger.info(
f"Committing batch: {documents_indexed} Gmail messages processed so far"
)
await session.commit()
except Exception as e:

View file

@ -351,10 +351,12 @@ async def index_jira_issues(
logger.info(
f"Successfully indexed new issue {issue_identifier} - {issue_title}"
)
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Jira issues processed so far")
logger.info(
f"Committing batch: {documents_indexed} Jira issues processed so far"
)
await session.commit()
except Exception as e:

View file

@ -370,10 +370,12 @@ async def index_linear_issues(
logger.info(
f"Successfully indexed new issue {issue_identifier} - {issue_title}"
)
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Linear issues processed so far")
logger.info(
f"Committing batch: {documents_indexed} Linear issues processed so far"
)
await session.commit()
except Exception as e:

View file

@ -437,10 +437,12 @@ async def index_luma_events(
session.add(document)
documents_indexed += 1
logger.info(f"Successfully indexed new event {event_name}")
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Luma events processed so far")
logger.info(
f"Committing batch: {documents_indexed} Luma events processed so far"
)
await session.commit()
except Exception as e:

View file

@ -356,12 +356,14 @@ async def index_notion_pages(
documents_indexed += 1
logger.info(f"Successfully updated Notion page: {page_title}")
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} documents processed so far")
logger.info(
f"Committing batch: {documents_indexed} documents processed so far"
)
await session.commit()
continue
# Document doesn't exist - create new one
@ -411,10 +413,12 @@ async def index_notion_pages(
session.add(document)
documents_indexed += 1
logger.info(f"Successfully indexed new Notion page: {page_title}")
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} documents processed so far")
logger.info(
f"Committing batch: {documents_indexed} documents processed so far"
)
await session.commit()
except Exception as e:

View file

@ -353,12 +353,14 @@ async def index_slack_messages(
session.add(document)
documents_indexed += 1
# Batch commit every 10 documents
if documents_indexed % 10 == 0:
logger.info(f"Committing batch: {documents_indexed} Slack channels processed so far")
logger.info(
f"Committing batch: {documents_indexed} Slack channels processed so far"
)
await session.commit()
logger.info(
f"Successfully indexed new channel {channel_name} with {len(formatted_messages)} messages"
)

View file

@ -36,7 +36,7 @@ export function GoogleLoginButton() {
<h1 className="my-8 text-xl font-bold text-neutral-800 dark:text-neutral-100 md:text-4xl">
{t("welcome_back")}
</h1>
{/*
{/*
<motion.div
initial={{ opacity: 0, y: -5 }}
animate={{ opacity: 1, y: 0 }}

View file

@ -337,7 +337,11 @@ const DashboardPage = () => {
</div>
</div>
</div>
<Link className="flex flex-1 flex-col p-4 cursor-pointer" href={`/dashboard/${space.id}/documents`} key={space.id}>
<Link
className="flex flex-1 flex-col p-4 cursor-pointer"
href={`/dashboard/${space.id}/documents`}
key={space.id}
>
<div className="flex flex-1 flex-col justify-between p-1">
<div>
<h3 className="font-medium text-lg">{space.name}</h3>

View file

@ -208,14 +208,16 @@ const ConnectorSelector = React.memo(
{getConnectorIcon(docType.type, "h-3 w-3")}
</div>
))}
{selectedLiveConnectors.slice(0, 3 - selectedDocTypes.slice(0, 2).length).map((connector) => (
<div
key={connector.id}
className="flex h-6 w-6 items-center justify-center rounded-full border-2 border-background bg-muted"
>
{getConnectorIcon(connector.connector_type, "h-3 w-3")}
</div>
))}
{selectedLiveConnectors
.slice(0, 3 - selectedDocTypes.slice(0, 2).length)
.map((connector) => (
<div
key={connector.id}
className="flex h-6 w-6 items-center justify-center rounded-full border-2 border-background bg-muted"
>
{getConnectorIcon(connector.connector_type, "h-3 w-3")}
</div>
))}
</div>
<span className="text-xs font-medium">
{totalSelectedCount} {totalSelectedCount === 1 ? "source" : "sources"}
@ -240,7 +242,7 @@ const ConnectorSelector = React.memo(
</DialogDescription>
</div>
{(isLoading || connectorsLoading) ? (
{isLoading || connectorsLoading ? (
<div className="flex justify-center py-8">
<div className="animate-spin h-8 w-8 border-3 border-primary border-t-transparent rounded-full" />
</div>
@ -293,9 +295,7 @@ const ConnectorSelector = React.memo(
</div>
<div className="flex-1 text-left min-w-0">
<div className="flex items-center gap-2">
<p className="text-sm font-medium truncate">
{connector.name}
</p>
<p className="text-sm font-medium truncate">{connector.name}</p>
{isSelected && (
<div className="flex h-5 w-5 items-center justify-center rounded-full bg-primary">
<Check className="h-3 w-3 text-primary-foreground" />
@ -590,7 +590,6 @@ const LLMSelector = React.memo(() => {
</p>
</div>
</div>
</div>
</SelectItem>
))}

View file

@ -1,8 +1,5 @@
"use client";
import Link from "next/link";
import Image from "next/image";
import {
AlertCircle,
BookOpen,
@ -20,6 +17,8 @@ import {
Trash2,
Undo2,
} from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import { memo, useMemo } from "react";
import { Logo } from "@/components/Logo";
@ -36,7 +35,6 @@ import {
SidebarMenuItem,
} from "@/components/ui/sidebar";
// Map of icon names to their components
export const iconMap: Record<string, LucideIcon> = {
BookOpen,
@ -218,21 +216,21 @@ export const AppSidebar = memo(function AppSidebar({
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton asChild size="lg">
<Link href="/" className="flex items-center gap-2 w-full">
<div className="bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg">
<Image
src="/icon-128.png"
alt="SurfSense logo"
width={32}
height={32}
className="rounded-lg"
/>
</div>
<div className="grid flex-1 text-left text-sm leading-tight">
<span className="truncate font-medium">SurfSense</span>
<span className="truncate text-xs">beta v0.0.8</span>
</div>
</Link>
<Link href="/" className="flex items-center gap-2 w-full">
<div className="bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg">
<Image
src="/icon-128.png"
alt="SurfSense logo"
width={32}
height={32}
className="rounded-lg"
/>
</div>
<div className="grid flex-1 text-left text-sm leading-tight">
<span className="truncate font-medium">SurfSense</span>
<span className="truncate text-xs">beta v0.0.8</span>
</div>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>