Skip to content

fix(bpmn): let the graph hash alone decide BPMN source staleness - #8079

Merged
sfmskywalker merged 2 commits into
mainfrom
claude/bpmn-8073-stale-after-publish
Sep 12, 2026
Merged

sfmskywalker merged 2 commits into
mainfrom
claude/bpmn-8073-stale-after-publish

Conversation

@sfmskywalker

Copy link
Copy Markdown
Member

Closes #8073. Part of #7909.

Problem

Publishing at version N and then saving anything through the designer, such as a rename or a variable change, creates draft N+1. That draft still carries Bpmn:SourceVersion = N. Because staleness required the version and the graph hash to match, the untouched BPMN source counted as stale. Export and the document GET refused, and Studio's binding editor told the user to re-import.

Fix

In BpmnInterchangeDocumentService.ResolveSourceXml, the single place staleness is decided for export, document GET and document PUT: when the Bpmn:SourceGraphHash marker is present, the graph hash alone decides. The version comparison applies only to definitions imported before the marker existed. The document ETag and the refusal codes are unchanged.

A graph change in the same draft, or in a new draft, still changes the hash, so it is still stale.

Tests

The tests simulate publishing by setting IsPublished on the stored row, through one shared helper (Support/PublishSimulation). The real publisher refuses a none-start BPMN process because of a separate defect, filed as #8078. The helper becomes a real PublishAsync call once that lands.

🤖 Generated with Claude Code

sfmskywalker and others added 2 commits September 12, 2026 18:52
A metadata-only save (a rename, a variable edit) bumps a published definition
to a new draft version without touching the graph, but the stale check
compared the version unconditionally, refusing export/document GET even
though the graph the stored source describes had not moved. Once the
graph-hash marker is present it now decides staleness on its own; the version
check remains only as a fallback for definitions imported before that marker
existed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

Safe to merge: the changed graph-hash behavior satisfies the metadata-only draft flow while preserving stale-source protections for graph edits.

What we checked:

  • The pre-change test run showed 3 selected tests with 2 passing and 1 failing; the new-draft metadata-only test expected OK but received UnprocessableEntity. T-Rex
  • The post-change test run showed 5 selected tests, all 5 passed. T-Rex
  • Compared the BPMN document and export contract before and after this change; the pre-change behavior returned 422 for metadata-only saves, while the current revision yields all five tests passing with the expected statuses. T-Rex

Summary

  • BPMN document access now remains available after a metadata-only designer save creates a new draft version without changing the activity graph.
  • BPMN document and export requests continue to reject stored source after an activity-graph edit, preventing callers from receiving BPMN that no longer represents the workflow.
  • Focused integration coverage passed for the metadata-only draft flow and the changed-graph refusal paths.

Reviews (1) · Last reviewed commit: "test(bpmn): share the simulated-publish ..."

@sfmskywalker
sfmskywalker merged commit fcb46a6 into main Sep 12, 2026
14 checks passed
@sfmskywalker
sfmskywalker deleted the claude/bpmn-8073-stale-after-publish branch September 12, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BPMN W31: a metadata-only save after publish marks the BPMN source stale

1 participant