VSCode Debugger Extension wrt Activities and Simulating sleep(' ') method

Hi everyone -, I saw these two videos on same examples -

  1. https://www.youtube.com/watch?v=3IjQde9HMNY
  2. https://www.youtube.com/watch?v=S4Xrc70zoCc

I need to know about vscode debugger extension for typescript SDK based workflows

  1. why cant i step into the activities - it seems the debugger only works for going step by step inside a workflow - if i place debug points inside activity - it doesnt stop there - it kinda skips the activities
  2. why doesn’t the debugger simulate the await sleep(‘30 seconds’) command - it seems the debugger simply walks over this as if nothing has happened - it doesnt actually wait for 30 seconds

Would appreciate if someone takes the time to answer this

consider the wf given below

import { condition, defineSignal, proxyActivities, setHandler, sleep } from '@temporalio/workflow';
import type * as activities from './activities';

export const verifySignal = defineSignal<[]>('verify');

const { notifyHumanForVerification, collectFeedback } = proxyActivities<typeof activities>({
  startToCloseTimeout: '1 minute',
});

export async function humanVerificationWorkflow(task: string) {
  let verified = false;

  await notifyHumanForVerification(task);
  setHandler(verifySignal, () => {
    verified = true;
  });

  await condition(() => verified);
  await sleep('30 seconds');
  await collectFeedback();
}

I am unable to do two things

  1. go inside notifyHumanForVerification or collectFeedback method and observe - how things are working
  2. simulate the 30 second wait period in the line - await sleep(‘30 second’)

Is any of this possible now, with temporal vscode debugger ?

The extension is only meant for debugging Workflow code. It runs a replay Worker, which just runs the Workflow code against an Event History, which has both the results of Activities and the record of the 30-second timer firing, so both of them resolve immediately and don’t talk to the Server to start a 30-second timer or schedule the Activity to be run. I’ve added a note to the README to clarify: Clarify README by lorensr · Pull Request #60 · temporalio/vscode-debugger-extension · GitHub

You can debug Activity code by running a normal Worker and setting a breakpoint in Activity code and starting a Workflow normally, without this extension.

1 Like

Thanks, thats very helpful