@@ -251,22 +251,30 @@ export const publishNode = async ({
251251 plugin,
252252 file,
253253 frontmatter,
254+ republish,
254255} : {
255256 plugin : DiscourseGraphPlugin ;
256257 file : TFile ;
257258 frontmatter : FrontMatterCache ;
259+ republish ?: boolean ;
258260} ) : Promise < void > => {
259261 const client = await getLoggedInClient ( plugin ) ;
260262 if ( ! client ) throw new Error ( "Cannot get client" ) ;
261263 const myGroups = new Set ( await getAvailableGroupIds ( client ) ) ;
262264 if ( myGroups . size === 0 ) throw new Error ( "Cannot get group" ) ;
263- await syncAllNodesAndRelations ( plugin ) ;
264265 const existingPublish =
265266 ( frontmatter . publishedToGroups as undefined | string [ ] ) || [ ] ;
267+ if ( ! republish ) await syncAllNodesAndRelations ( plugin ) ;
266268 const commonGroups = existingPublish . filter ( ( g ) => myGroups . has ( g ) ) ;
267269 // temporary single-group assumption
268270 const myGroup = ( commonGroups . length > 0 ? commonGroups : [ ...myGroups ] ) [ 0 ] ! ;
269- return await publishNodeToGroup ( { plugin, file, frontmatter, myGroup } ) ;
271+ return await publishNodeToGroup ( {
272+ plugin,
273+ file,
274+ frontmatter,
275+ myGroup,
276+ republish,
277+ } ) ;
270278} ;
271279
272280export const ensurePublishedRelationsAccuracy = async ( {
@@ -414,11 +422,13 @@ export const publishNodeToGroup = async ({
414422 file,
415423 frontmatter,
416424 myGroup,
425+ republish,
417426} : {
418427 plugin : DiscourseGraphPlugin ;
419428 file : TFile ;
420429 frontmatter : FrontMatterCache ;
421430 myGroup : string ;
431+ republish ?: boolean ;
422432} ) : Promise < void > => {
423433 const nodeId = frontmatter . nodeInstanceId as string | undefined ;
424434 if ( ! nodeId ) throw new Error ( "Please sync the node first" ) ;
@@ -465,7 +475,8 @@ export const publishNodeToGroup = async ({
465475 ) ;
466476
467477 const skipPublishAccess =
468- existingPublish . includes ( myGroup ) && lastModified <= lastModifiedDb ;
478+ republish ||
479+ ( existingPublish . includes ( myGroup ) && lastModified <= lastModifiedDb ) ;
469480
470481 if ( ! skipPublishAccess ) {
471482 const publishSpaceResponse = await client . from ( "SpaceAccess" ) . upsert (
0 commit comments