File tree 2 files changed +18
-9
lines changed
packages/gatsby-source-wordpress/src/steps
source-nodes/update-nodes/wp-actions 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { formatLogMessage } from "~/utils/format-log-message"
19
19
import { touchValidNodes } from "../source-nodes/update-nodes/fetch-node-updates"
20
20
21
21
import { Reporter } from "gatsby/reporter"
22
+ import { invokeAndCleanupLeftoverPreviewCallbacks } from "./cleanup"
22
23
23
24
const inDevelopPreview =
24
25
process . env . NODE_ENV === `development` &&
@@ -367,14 +368,11 @@ export const sourcePreviews = async (helpers: GatsbyHelpers): Promise<void> => {
367
368
dump ( webhookBody )
368
369
}
369
370
370
- if ( previewForIdIsAlreadyBeingProcessed ( webhookBody ?. id ) ) {
371
- if ( inPreviewDebugMode ) {
372
- reporter . info (
373
- `Preview for id ${ webhookBody ?. id } is already being sourced.`
374
- )
375
- }
376
- return
377
- }
371
+ // in case there are preview callbacks from our last build
372
+ await invokeAndCleanupLeftoverPreviewCallbacks ( {
373
+ status : `GATSBY_PREVIEW_PROCESS_ERROR` ,
374
+ context : `Starting sourcePreviews` ,
375
+ } )
378
376
379
377
const wpGatsbyPreviewNodeManifestsAreSupported =
380
378
await remoteSchemaSupportsFieldNameOnTypeName ( {
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export const fetchAndCreateSingleNode = async ({
24
24
cachedNodeIds,
25
25
token = null ,
26
26
isPreview = false ,
27
+ isDraft = false ,
27
28
userDatabaseId = null ,
28
29
} ) => {
29
30
function getNodeQuery ( ) {
@@ -34,7 +35,7 @@ export const fetchAndCreateSingleNode = async ({
34
35
// if it's a preview but it's the initial blank node
35
36
// then use the regular node query as the preview query wont
36
37
// return anything
37
- const query = isPreview ? previewQuery : nodeQuery
38
+ const query = isPreview && ! isDraft ? previewQuery : nodeQuery
38
39
39
40
return query
40
41
}
@@ -81,6 +82,16 @@ export const fetchAndCreateSingleNode = async ({
81
82
)
82
83
)
83
84
85
+ reporter . info ( {
86
+ singleName,
87
+ id,
88
+ actionType,
89
+ cachedNodeIds,
90
+ token,
91
+ isPreview,
92
+ userDatabaseId,
93
+ } )
94
+
84
95
return { node : null }
85
96
}
86
97
You can’t perform that action at this time.
0 commit comments