Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

204 NO CONTENT regression fix #170

Merged
merged 6 commits into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- Fix regression on handling PreventUpdate (204 NO CONTENT) [#170](https://github.com/plotly/dash-renderer/pull/170)

## [0.23.0] - 2019-04-25
### Fixed
- Fix regression for `children=0` case [#148](https://github.com/plotly/dash-renderer/issues/148)
Expand Down
11 changes: 8 additions & 3 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,13 +674,18 @@ function updateOutput(
// update the status of this request
updateRequestQueue(true, res.status);

/*
* This is a 204 response code, there's no content to process.
*/
if (res.status === STATUS.PREVENT_UPDATE) {
return;
}

/*
* eject into `catch` handler below to display error
* message in ui
*/
if (res.status !== STATUS.PREVENT_UPDATE) {
throw res;
}
throw res;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def update_input(value):
'lxml').select_one('#output > div').contents

self.assertTrue(
pad_input.attrs == {'id': 'sub-input-1', 'value': 'sub input initial value'}
pad_input.attrs == {'type': 'text', 'id': 'sub-input-1', 'value': 'sub input initial value'}
and pad_input.name == 'input',
"pad input is correctly rendered")

Expand Down