Skip to content

appmap archive drops sequence diagrams on "failed trying to compute event stack" and still reports success, so appmap compare shows changed traces as unchanged #2399

Description

@evlawler

@kgilpin

Version. @appland/appmap 3.201.4, Node 22.22.2, Linux.

What happens. appmap archive fails to build the sequence diagram for some recordings, logs one line per file, then prints "Generated 6 sequence diagrams" and exits 0. appmap compare then treats the traces without diagrams as unchanged. Four recordings that differ between two revisions were reported as "0 changed".

Generating sequence diagrams...
Generating sequence diagrams failed to process appmaps/vitest/creates_a_session_for_an_initialize_request_and_serves_a_follow-up_request_on_it.appmap.json: Error: failed trying to compute event stack, call.id: 1
Generating sequence diagrams failed to process appmaps/vitest/terminates_a_session_on_DELETE_and_refuses_later_requests_for_it.appmap.json: Error: failed trying to compute event stack, call.id: 1
Generated 6 sequence diagrams in 45ms

The same file works standalone.

appmap sequence-diagram --format json --output-dir sd appmaps/vitest/expires_a_session_whose_last_access_is_older_than_the_session_timeout.appmap.json
# exit 0, diagram written

So the failure is in the filter archive applies before drawing, not in the recording.

Reproduce. The four recordings are committed in the private repository evlawler/goldtrace-examples, folder n8n-mcp-session-cleanup-recursion/files/head/gold_traces/baseline/appmaps/vitest/. Smallest is 36 KB, 120 events, recorded by appmap-node 2.26.3 from a vitest test. Copy them to appmaps/, add appmap.yml with appmap_dir: appmaps, run appmap archive in a git repository. All four fail the same way.

What the recordings contain. An HTTP request whose return is interleaved with a req.on('close') continuation, and a session removal that re-enters itself from the transport close handler several levels deep.

Two asks.

  1. The event stack computation should handle these traces, or at minimum the filter should fall back to the unfiltered diagram the standalone command produces.
  2. archive should not report success and compare should not report "unchanged" for a trace that has no diagram. A missing diagram should be an error or an explicit "not compared".

Workaround used. Generate diagrams for each side with appmap sequence-diagram --format json, place them where compare expects them, run appmap compare directly. Result: 4 changed, 2 new, 0 removed.

Filed by Claude in a Claude Code session for Elizabeth Lawler.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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