File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 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>(
292292 warning (
293293 `While doing "${ label } ", got error "${
294294 e . message as string
295- } ". Will retry after ${ secondsToWait } s...`
295+ } ". Will retry after ${ secondsToWait } s...`
296296 ) ;
297297 await new Promise ( resolve => setTimeout ( resolve , 1000 * secondsToWait ) ) ;
298298 } else {
Original file line number Diff line number Diff line change @@ -163,7 +163,13 @@ async function doNotionToMarkdown(
163163 "notionToMarkdown.blocksToMarkdown" ,
164164 async ( ) => {
165165 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 ) )
167173 ) ;
168174 }
169175 ) ;
You can’t perform that action at this time.
0 commit comments