Skip to content

[JENKINS-75793] Fix inconsistent rendered values when using multiple reactiveChoice parameters#960

Open
baczus wants to merge 1 commit into
jenkinsci:masterfrom
baczus:bugfix/902
Open

[JENKINS-75793] Fix inconsistent rendered values when using multiple reactiveChoice parameters#960
baczus wants to merge 1 commit into
jenkinsci:masterfrom
baczus:bugfix/902

Conversation

@baczus
Copy link
Copy Markdown

@baczus baczus commented Mar 25, 2026

This PR fixes issue #902.

Root cause:

In the makeStaplerProxy2 function (introduced in v2.8.4 when PR #79 was reverted), the .then() handler inside the fetch call was missing return statements before response.json().then(...) and response.text().then(...). Without those returns, the outer await resolved as soon as the HTTP response headers arrived, before the response body was parsed and the callback was invoked. This broke the serialization of cascade parameter updates -- when rapidly changing env, the doUpdate and getChoicesForUI calls for chained parameters (stream, commit) could overlap, causing stale values (e.g., dev_commit1 showing up when prod was selected).

Fix:

Added return before both response.json().then(...) and response.text().then(...) in makeStaplerProxy2, so the promise chain properly propagates and await blocks until the callback completes.

Testing done

I tested the fix locally using the test job provided in the original issue, against the latest Jenkins LTS version.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@baczus baczus requested a review from a team as a code owner March 25, 2026 16:40
@kinow kinow self-assigned this Mar 25, 2026
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.

2 participants