File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ export async function executeWithRateLimitAndRetries<T>(
292
292
warning (
293
293
`While doing "${ label } ", got error "${
294
294
e . message as string
295
- } ". Will retry after ${ secondsToWait } s...`
295
+ } ". Will retry after ${ secondsToWait } s...`
296
296
) ;
297
297
await new Promise ( resolve => setTimeout ( resolve , 1000 * secondsToWait ) ) ;
298
298
} else {
Original file line number Diff line number Diff line change @@ -163,7 +163,13 @@ async function doNotionToMarkdown(
163
163
"notionToMarkdown.blocksToMarkdown" ,
164
164
async ( ) => {
165
165
mdBlocks = await docunotionContext . notionToMarkdown . blocksToMarkdown (
166
- blocks
166
+ // We need to provide a copy of blocks.
167
+ // Calling blocksToMarkdown can modify the values in the blocks. If it does, and then
168
+ // we have to retry, we end up retrying with the modified values, which
169
+ // causes various issues (like using the transformed image url instead of the original one).
170
+ // Note, currently, we don't do anything else with blocks after this.
171
+ // If that changes, we'll need to figure out a more sophisticated approach.
172
+ JSON . parse ( JSON . stringify ( blocks ) )
167
173
) ;
168
174
}
169
175
) ;
You can’t perform that action at this time.
0 commit comments