angular / batarang

AngularJS WebInspector Extension for Chrome
MIT License
2.43k stars 338 forks source link

fix(background.js) buffer de-serialized model info #247

Closed gary-b closed 9 years ago

gary-b commented 9 years ago

After devTools was closed and reopened the jsonTree showed raw json. This was because background.js was storing the model values as a json string. Since background.js and inspectedApp now both need the de-serialized representation of the model, moving the parsing code into background.js and replacing the string model with the de-serialized representation on the message itself, thus DRYing up the code.

Fixes issue #246

I'm not entirely sure why the model is passed around as json in the first place - hopefully me converting it back to an object within background.js isn't an issue.

I changed the name of the bufferOrForward function - it never is mutually exclusive so it should at least be called bufferAndSometimesForward :). What were doing though seems to be message brokering by the definition here https://en.wikipedia.org/wiki/Message_broker and using this name gives better context imho.

SomeKittens commented 9 years ago

@erwinmombay is this related to your Rx fix?

erwinmombay commented 9 years ago

@SomeKittens slightly, but shouldn't affect the work i'm doing nor do they overlap.

erwinmombay commented 9 years ago

@gary-b mind resubmitting and seeing if the build passes? Thanks!

btford commented 9 years ago

@erwinmombay – the build is broken because of me (or some outdated infrastructure). I don't think resubmitting will fix it, but I'll try rerunning it just to be sure.

I'm going to make the CI green in (hopefully) the next hour-ish, and then it should be straightforward to get this in.

Sorry that this took so long, @gary-b, and thanks for taking the time to submit a PR. :)

btford commented 9 years ago

Landed as 1304979492a79e1c29758f41d5e4c9b69c672e3b.

Thanks!