alexanderdean / Unified-Log-Processing

Supporting material (code, schemas etc) for Unified Log Processing (Manning Publications)
http://manning.com/dean/
Apache License 2.0
97 stars 25 forks source link

Bulletproof abandoned cart stream process() against bad input #34

Open jf opened 8 years ago

alexanderdean commented 8 years ago

This is a good idea @jf - thanks for raising! Will merge when I get a chance to update the corresponding chapter...

jf commented 8 years ago

Sure, but fyi I discovered this myself when I tried to copy and paste some of the events from the pdf. The text as found in the pdf is such that some of those timestamps are invalid, which will cause a problem. e.g. the 2nd event on p.31: copied and pasted, there is a space in the timestamp, which apparently causes an error (and in the sku code too, but that's not a big deal because it doesn't cause any errors):

{ "event": "SHOPPER_ADDED_ITEM_TO_CART", "shopper": { "id": "762", "name": "Sue", "ipAddress": "65.34.103.11" }, "items": [ { "product": { "sku": "ms- 003", "name" : "XBox One" }, "quantity": 2 } ], "timestamp": "2015-09- 03T12:03:45Z" }

See that space between 2015-09-, and 03T...?

jf commented 8 years ago

(This is based on the 'Last saved: 1/18/2016' version, btw, in case you need to date it)

alexanderdean commented 8 years ago

Thanks @jf - will fix that in the manuscript!

jf commented 8 years ago

hi Alexander, would you mind just closing this issue once the manuscript has been fixed? Just so I know and can keep a lookout. Thanks!

alexanderdean commented 8 years ago

I will - thanks @jf

jf commented 7 years ago

hi Alexander, just to follow up on this (I don't have access to the manuscript just yet, so I can't verify it for myself) - did this ever get fixed?

alexanderdean commented 7 years ago

Not yet! It's still on the list. Thanks for reminding me...