diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e1bd29118..c13f22c1ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ This project adheres to [Semantic Versioning](https://semver.org/). - [#3080](https://github.com/plotly/dash/pull/3080) Fix docstring generation for components using single-line or nonstandard-indent leading comments - [#3103](https://github.com/plotly/dash/pull/3103) Fix Graph component becomes unresponsive if an invalid figure is passed +## Changed +- [#3113](https://github.com/plotly/dash/pull/3113) Adjusted background polling requests to strip the data from the request, this allows for context to flow as normal. This addresses issue [#3111](https://github.com/plotly/dash/pull/3111) + + ## [2.18.2] - 2024-11-04 ## Fixed diff --git a/dash/dash-renderer/src/actions/callbacks.ts b/dash/dash-renderer/src/actions/callbacks.ts index 23da0a3ff3..0609af94f9 100644 --- a/dash/dash-renderer/src/actions/callbacks.ts +++ b/dash/dash-renderer/src/actions/callbacks.ts @@ -439,6 +439,7 @@ function handleServerside( const fetchCallback = () => { const headers = getCSRFHeader() as any; let url = `${urlBase(config)}_dash-update-component`; + let newBody = body; const addArg = (name: string, value: string) => { let delim = '?'; @@ -447,11 +448,19 @@ function handleServerside( } url = `${url}${delim}${name}=${value}`; }; - if (cacheKey) { - addArg('cacheKey', cacheKey); - } - if (job) { - addArg('job', job); + if (cacheKey || job) { + if (cacheKey) addArg('cacheKey', cacheKey); + if (job) addArg('job', job); + + // clear inputs as background callback doesnt need inputs, just verify for context + const tmpBody = JSON.parse(newBody); + for (let i = 0; i < tmpBody.inputs.length; i++) { + tmpBody.inputs[i]['value'] = null; + } + for (let i = 0; i < (tmpBody?.state || []).length; i++) { + tmpBody.state[i]['value'] = null; + } + newBody = JSON.stringify(tmpBody); } if (moreArgs) { @@ -464,7 +473,7 @@ function handleServerside( mergeDeepRight(config.fetch, { method: 'POST', headers, - body + body: newBody }) ); };