Skip to content

Commit

Permalink
Merge pull request #241 from collective/fix-delete-node
Browse files Browse the repository at this point in the history
Add to touch node before delete to fix issue where deletion broke inc…
  • Loading branch information
datakurre committed Aug 30, 2019
2 parents a527fdb + 14a1643 commit 14e2084
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ exports.sourceNodes = async (
updateParents.add(parentId(node.id));
}
reporter.info(`Deleting node – ${node.id.replace(baseUrl, '') || '/'}`);
touchNode({ nodeId: node.id }); // deleting fails without plugin ownrship touch
deleteNode({ node: node });
for (const id of node.children || []) {
const child = getNode(id);
if (child) {
reporter.info(`Deleting node – ${id.replace(baseUrl, '') || '/'}`);
touchNode({ nodeId: node.id }); // deleting fails without touch
deleteNode({ node: child });
}
}
Expand Down

0 comments on commit 14e2084

Please sign in to comment.