New issue
Advanced search Search tips

Issue 775105 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

DevTools: worker agent's Target.sendMessageToTarget does not have error handling

Project Member Reported by pfeldman@chromium.org, Oct 16 2017

Issue description

Sending a message with malformed JSON is silently swallowed:

sendMessagE("Target.sendMessageToTarget", {sessionId: sessionId, message:"{\"id\": 1, \"method\":\"Runtime.evaluate\", \"args\": {\"expression\": \"console.log('blah');\", silent:false, awaitPromise:true}}")

leads to no result due to no quotes around silend, awaitPromise.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/deps/inspector_protocol/+/bdfbb48cdc1a1ccd7dc9456506feab46c8ffe90c

commit bdfbb48cdc1a1ccd7dc9456506feab46c8ffe90c
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Thu Oct 19 18:00:45 2017

[inspector_protocol] added UberDispatcher::getCommandName

This method parse command name and send error on invalid message.

Bug: chromium:775105 
Change-Id: I61f7e395fbfbe6d77e85e18f479b5d992d5f66aa
TBR=dgozman@chromium.org

[modify] https://crrev.com/bdfbb48cdc1a1ccd7dc9456506feab46c8ffe90c/lib/DispatcherBase_cpp.template
[modify] https://crrev.com/bdfbb48cdc1a1ccd7dc9456506feab46c8ffe90c/lib/DispatcherBase_h.template

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26

commit 78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26
Author: Alexey Kozyatinskiy <kozyatinskiy@chromium.org>
Date: Sun Oct 22 02:05:23 2017

[DevTools] better errors for Target.sendMessageToTarget

Methods should generate notification with error on invalid
message.

inspector_protocol rolled to bdfbb48cdc1a1ccd7dc9456506feab46c8ffe90c:
- [inspector_protocol] added UberDispatcher::getCommandName

R=dgozman@chromium.org

Bug:  chromium:775105 
Change-Id: I47be11a4b1203781472a83c8ae38566a286f1e4d
Reviewed-on: https://chromium-review.googlesource.com/722662
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510698}
[modify] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/WebKit/LayoutTests/http/tests/devtools/report-protocol-errors-expected.txt
[add] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/WebKit/LayoutTests/inspector-protocol/target/target-send-message-expected.txt
[add] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/WebKit/LayoutTests/inspector-protocol/target/target-send-message.js
[modify] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/WebKit/Source/core/inspector/InspectorSession.cpp
[modify] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/WebKit/Source/core/inspector/InspectorSession.h
[modify] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp
[modify] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/inspector_protocol/README.chromium
[modify] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/inspector_protocol/lib/DispatcherBase_cpp.template
[modify] https://crrev.com/78e1cc855a8e7d3289e4ca0cc3b698d5ff954e26/third_party/inspector_protocol/lib/DispatcherBase_h.template

Status: Fixed (was: Assigned)

Sign in to add a comment