|
1 | 1 | /* eslint-disable @typescript-eslint/naming-convention */ |
| 2 | +import { uuidv7 } from "uuidv7"; |
2 | 3 | import { Notice, TFile } from "obsidian"; |
3 | 4 | import { DGSupabaseClient } from "@repo/database/lib/client"; |
4 | 5 | import { Json } from "@repo/database/dbTypes"; |
@@ -101,7 +102,10 @@ const deleteNodesFromSupabase = async ( |
101 | 102 | if (conceptDeleteError) { |
102 | 103 | result.success = false; |
103 | 104 | result.errors.concept = conceptDeleteError; |
104 | | - console.error("Failed to delete concepts from Supabase:", conceptDeleteError); |
| 105 | + console.error( |
| 106 | + "Failed to delete concepts from Supabase:", |
| 107 | + conceptDeleteError, |
| 108 | + ); |
105 | 109 | } |
106 | 110 |
|
107 | 111 | const { error: contentDeleteError } = await supabaseClient |
@@ -152,7 +156,7 @@ const ensureNodeInstanceId = async ( |
152 | 156 | return existingId; |
153 | 157 | } |
154 | 158 |
|
155 | | - const nodeInstanceId = crypto.randomUUID(); |
| 159 | + const nodeInstanceId = uuidv7(); |
156 | 160 | await plugin.app.fileManager.processFrontMatter(file, (fm) => { |
157 | 161 | (fm as Record<string, unknown>).nodeInstanceId = nodeInstanceId; |
158 | 162 | }); |
@@ -195,7 +199,6 @@ const mergeChangeTypes = ( |
195 | 199 | return Array.from(merged); |
196 | 200 | }; |
197 | 201 |
|
198 | | - |
199 | 202 | /** |
200 | 203 | * Step 1: Collect all discourse nodes from the vault |
201 | 204 | * Filters markdown files that have nodeTypeId in frontmatter |
@@ -635,10 +638,7 @@ export const syncSpecificFiles = async ( |
635 | 638 | const changeTypesByPath = new Map<string, ChangeType[]>(); |
636 | 639 | for (const filePath of filePaths) { |
637 | 640 | const existing = changeTypesByPath.get(filePath) ?? []; |
638 | | - changeTypesByPath.set( |
639 | | - filePath, |
640 | | - mergeChangeTypes(existing, ["content"]), |
641 | | - ); |
| 641 | + changeTypesByPath.set(filePath, mergeChangeTypes(existing, ["content"])); |
642 | 642 | } |
643 | 643 |
|
644 | 644 | await syncDiscourseNodeChanges(plugin, changeTypesByPath); |
|
0 commit comments