Skip to content

Debugger fails when state-changes lack account information #5

@dragmz

Description

@dragmz

Summary:
The debugger (algokit-avm-vscode-debugger v1.1.6) encounters an issue when processing state-changes objects, specifically with app-state-type == "l" but lack associated account data (e.g., when apat is missing). The debugger will fail to launch and instead throws an error:

Cannot read properties of undefined (reading 'toString')


Example state-changes object:

{
  "pc": 1829,
  "stack-pop-count": 3,
  "state-changes": [
    {
      "app-state-type": "l",
      "key": "dG90YWxfZmVlX3NoYXJl",
      "operation": "w"
    }
  ]
}

This error can be seen in the screenshot below:
Error message when launching the debugger with state-changes missing account


Additional info:

  • The debugger should ideally be able to launch even if the state change is missing account data.
  • Reference code location: traceReplayEngine.ts#L162

Steps to reproduce:

  1. Attempt to start the debugger for the attached trace file
  2. Observe that it fails with the error above.

Expected result:
The debugger should launch successfully—even if the state-change lacks account info—and handle missing fields gracefully.


debug.avm.trace.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions