Skip to content

Commit

Permalink
fix(tests): defer isCanceled check in Default#executeAction
Browse files Browse the repository at this point in the history
to allow interrupt tests to work. hopefully.

Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed May 4, 2024
1 parent 884250a commit 1f5391b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/strategies/Default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TAdapter } from '../interfaces/Adapter'
import { CancelledSyncError, FailsafeError } from '../../errors/Error'

import NextcloudBookmarksAdapter from '../adapters/NextcloudBookmarks'
import { setImmediate } from 'timers'

export default class SyncProcess {
protected mappings: Mappings
Expand Down Expand Up @@ -686,6 +687,8 @@ export default class SyncProcess {
}

async executeAction(resource:TResource, action:Action, targetLocation:TItemLocation, plan: Diff, donePlan: Diff = null):Promise<void> {
// defer execution of actions to allow the this.canceled check below to work when cancelling in interrupt tests
await new Promise((resolve) => setImmediate(resolve))
Logger.log('Executing action ', action)
const item = action.payload
const done = () => {
Expand Down

0 comments on commit 1f5391b

Please sign in to comment.