Skip to content

Write delayexecution only for a property with a value - #92

Merged
jwrosewell merged 3 commits into
rcfrom
fix/json-builder-delayexecution-with-value
Nov 12, 2026
Merged

jwrosewell merged 3 commits into
rcfrom
fix/json-builder-delayexecution-with-value

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The JSON Builder writes delayexecution for every Property whose metadata has the delay execution flag set, before it reads the Property's value (jsonbundler.py lines 178 to 182 on rc at 126d3733). So a Property assigned no value, a Property whose value is a plain null and a Property that cannot be read are all still marked, and the last two get a delayexecution entry with no entry for the Property itself.

What the specification says

json-builder.md line 71, specifications at 6570727d, in the Process section's table of meta-Properties:

| delayexecution | This meta-Property MUST be added with the value 'true' for each Property that has a value and whose metadata delay execution flag is true. |

.NET, Java, Go and PHP write delayexecution only once they have a value.

Language Where, on each repository's rc
.NET JsonBuilderElement.cs lines 759 to 785 at de7d1922, inside if (propertyValue != null)
Java JsonBuilderElement.java lines 307 to 338 at 0b9257f4, inside if (propertyValue != null)
Go jsonbuilder.go lines 155 to 157 at 37c4592f, if ok && !isNull && pm.DelayExecution
PHP JsonBundlerElement.php lines 216 to 220 at 5be49565, in the branch for a value that is not null

Node.js still writes it before reading the value (jsonbundler.js lines 168 to 170 at 871e7a37), and has the same change open as 51degrees-node#66.

What changed

jsonbundler.py writes delayexecution after the value is read, and only when the value is not None (lines 243 to 247 at the head). Each way through the loop body for one Property now ends as follows.

  1. A Property that cannot be read leaves through except: ... continue (lines 226 to 229) and gets no delayexecution.
  2. A Property assigned no value has value set to None and gets its null and nullreason, with no delayexecution.
  3. A plain null gets no entry and no delayexecution.
  4. A Property with a value, including a list of records or a WKT value, gets delayexecution when its metadata flag is set.

Records inside a list are written by record_json, which writes no delayexecution and which this draft does not change. The evidenceproperties entry is unchanged, and the JavaScript Properties list is unchanged.

The current rc (126d373) is merged into the branch at 605db3d with GitHub's update branch, and the merge was clean. rc changed jsonbundler.py in two places since this draft was opened, the exclusion list (#70) and the error text with no sequence number (#101), neither of which touches the lines this draft changes. The whole difference from rc is jsonbundler.py and the new test.

How it was verified

New test test_jsonbundler_delayexecution.py, with one delayed Property that has a value, one assigned no value and one plain null.

  • Red, rc at 126d373 with the new test and nothing else: run 43299392982 fails. The test fails on its assertion, AssertionError: 'novaluedelayexecution' unexpectedly found in {'withvaluedelayexecution': True, 'withvalue': 'script', 'novaluedelayexecution': True, 'novalue': None, 'novaluenullreason': 'No script', 'plainnulldelayexecution': True}, and the core tests give 1 failed and 479 passed.
  • Green, the head 605db3d: run 43299431507 passes. The test passes and the core tests give 480 passed.
  • Full build of the head 605db3db55a73d08148bb0f7d18ad91e3e87ba54: run 43299555028 succeeded on tmp/pr-matrix-92x, built from rc at 126d373, with all ten Build and Test jobs (Ubuntu and Windows, Python 3.10 to 3.14) green. Every one of the 11 Setting 'PullRequestSha' lines in its job logs reads the head, Configure printed "Left out 5 macOS entries", and the new test ran and passed in the Ubuntu Python 3.10 job.

Red and green ran on throwaway branches, tmp/fixpy-delay-red-rc (af6401e, being rc plus the test, a temporary workflow and its list of tests) and tmp/fixpy-delay-green-rc (7247ca3, being the head plus the same workflow and list). The red and green runs of 10 November were on the older base fc68b1e and are replaced by these.

macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.

What remains

Nothing in this change. #91 changes the same file at lines 126 to 130, the exclusion list, away from lines 175 to 247 that this draft changes.

The last release into main (#39) merged on 2026-11-04.

@jwrosewell jwrosewell mentioned this pull request Nov 12, 2026
@jwrosewell
jwrosewell marked this pull request as ready for review November 12, 2026 21:10
@jwrosewell
jwrosewell merged commit ddbd95d into rc Nov 12, 2026
3 checks passed
@jwrosewell
jwrosewell deleted the fix/json-builder-delayexecution-with-value branch November 12, 2026 21:11
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.

1 participant