From 715ce859d0cf5e0e842453ea28c58267dbc1162c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 9 May 2019 16:43:19 -0400 Subject: [PATCH 1/6] regression fix --- src/actions/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/actions/index.js b/src/actions/index.js index 155c3f9..2a55ca1 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -680,6 +680,11 @@ function updateOutput( */ if (res.status !== STATUS.PREVENT_UPDATE) { throw res; + } else { + /* + * This is a 204 response code, there's no content to process. + */ + return; } } From faa08c21405fcc3e065889857c0f54c255d7e3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Thu, 9 May 2019 16:45:41 -0400 Subject: [PATCH 2/6] changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9a2fa0..a6bb773 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) From 08905f4df0ea7959f6e84efed2d529839a0c9338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 10 May 2019 08:33:03 -0400 Subject: [PATCH 3/6] clean up --- src/actions/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index 2a55ca1..6547e81 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -675,17 +675,17 @@ function updateOutput( updateRequestQueue(true, res.status); /* - * eject into `catch` handler below to display error - * message in ui - */ - if (res.status !== STATUS.PREVENT_UPDATE) { - throw res; - } else { - /* - * This is a 204 response code, there's no content to process. - */ + * 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 + */ + throw res; } /* From f7a0b7f99103640f1410cb5a85d01377ae3cd949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 10 May 2019 08:35:26 -0400 Subject: [PATCH 4/6] format --- src/actions/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index 6547e81..c2fd5cd 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -675,16 +675,16 @@ function updateOutput( updateRequestQueue(true, res.status); /* - * This is a 204 response code, there's no content to process. - */ + * 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 - */ + * eject into `catch` handler below to display error + * message in ui + */ throw res; } From 3c48bf8b503fbc5b93a01e9b4d8a9adea0ed3fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 10 May 2019 09:33:44 -0400 Subject: [PATCH 5/6] test_callbacks_generating_children prints --- tests/test_render.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_render.py b/tests/test_render.py index 8b51f5f..396ba59 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -328,6 +328,9 @@ def update_input(value): '#react-entry-point').get_attribute('innerHTML'), 'lxml').select_one('#output > div').contents + print('************************') + print(pad_input.attrs) + print(pad_input.name) self.assertTrue( pad_input.attrs == {'id': 'sub-input-1', 'value': 'sub input initial value'} and pad_input.name == 'input', From fd00062efd029de07b4bbfb5f8b8fcd5f937829c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Fri, 10 May 2019 10:02:17 -0400 Subject: [PATCH 6/6] fix test --- tests/test_render.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_render.py b/tests/test_render.py index 396ba59..ce6ba5a 100644 --- a/tests/test_render.py +++ b/tests/test_render.py @@ -328,11 +328,8 @@ def update_input(value): '#react-entry-point').get_attribute('innerHTML'), 'lxml').select_one('#output > div').contents - print('************************') - print(pad_input.attrs) - print(pad_input.name) 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")