Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix deleted at timestamp mismatch
  • Loading branch information
Theodore Li committed Mar 14, 2026
commit aab13816fe73b271b7bc9711cdacc7fdad26e246
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function RecentlyDeleted() {
id: wf.id,
name: wf.name,
type: 'workflow',
deletedAt: new Date(wf.lastModified),
deletedAt: wf.archivedAt ? new Date(wf.archivedAt) : new Date(wf.lastModified),
workspaceId: wf.workspaceId ?? workspaceId,
color: wf.color,
})
Expand All @@ -149,7 +149,7 @@ export function RecentlyDeleted() {
id: kb.id,
name: kb.name,
type: 'knowledge',
deletedAt: new Date(kb.updatedAt),
deletedAt: kb.deletedAt ? new Date(kb.deletedAt) : new Date(kb.updatedAt),
workspaceId: kb.workspaceId ?? workspaceId,
})
}
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/components/emcn/components/toast/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const ToastItem = memo(function ToastItem({
<div className='flex flex-col gap-[8px] p-[8px]'>
<div className='flex items-start gap-[8px]'>
{data.icon && (
<span className='mt-[1px] shrink-0 text-[var(--text-icon)]'>{data.icon}</span>
<span className='flex h-[16px] shrink-0 items-center text-[var(--text-icon)]'>{data.icon}</span>
)}
<div className='line-clamp-2 min-w-0 flex-1 font-medium text-[12px] text-[var(--text-body)]'>
{data.variant === 'error' && (
Expand Down
1 change: 1 addition & 0 deletions apps/sim/hooks/queries/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function mapWorkflow(workflow: any): WorkflowMetadata {
sortOrder: workflow.sortOrder ?? 0,
createdAt: new Date(workflow.createdAt),
lastModified: new Date(workflow.updatedAt || workflow.createdAt),
archivedAt: workflow.archivedAt ? new Date(workflow.archivedAt) : null,
}
}

Expand Down
4 changes: 4 additions & 0 deletions apps/sim/lib/knowledge/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export async function getKnowledgeBases(
chunkingConfig: knowledgeBase.chunkingConfig,
createdAt: knowledgeBase.createdAt,
updatedAt: knowledgeBase.updatedAt,
deletedAt: knowledgeBase.deletedAt,
workspaceId: knowledgeBase.workspaceId,
docCount: count(document.id),
})
Expand Down Expand Up @@ -171,6 +172,7 @@ export async function createKnowledgeBase(
chunkingConfig: data.chunkingConfig,
createdAt: now,
updatedAt: now,
deletedAt: null,
workspaceId: data.workspaceId,
docCount: 0,
connectorTypes: [],
Expand Down Expand Up @@ -237,6 +239,7 @@ export async function updateKnowledgeBase(
chunkingConfig: knowledgeBase.chunkingConfig,
createdAt: knowledgeBase.createdAt,
updatedAt: knowledgeBase.updatedAt,
deletedAt: knowledgeBase.deletedAt,
workspaceId: knowledgeBase.workspaceId,
docCount: count(document.id),
})
Expand Down Expand Up @@ -286,6 +289,7 @@ export async function getKnowledgeBaseById(
chunkingConfig: knowledgeBase.chunkingConfig,
createdAt: knowledgeBase.createdAt,
updatedAt: knowledgeBase.updatedAt,
deletedAt: knowledgeBase.deletedAt,
workspaceId: knowledgeBase.workspaceId,
docCount: count(document.id),
})
Expand Down
2 changes: 2 additions & 0 deletions apps/sim/lib/knowledge/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface KnowledgeBaseWithCounts {
chunkingConfig: ChunkingConfig
createdAt: Date
updatedAt: Date
deletedAt: Date | null
workspaceId: string | null
docCount: number
connectorTypes: string[]
Expand Down Expand Up @@ -126,6 +127,7 @@ export interface KnowledgeBaseData {
chunkingConfig: ExtendedChunkingConfig
createdAt: string
updatedAt: string
deletedAt?: string | null
workspaceId?: string
connectorTypes?: string[]
}
Expand Down
1 change: 1 addition & 0 deletions apps/sim/stores/workflows/registry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface WorkflowMetadata {
workspaceId?: string
folderId?: string | null
sortOrder: number
archivedAt?: Date | null
}

export type HydrationPhase =
Expand Down