Today was a pretty big step forward in my little project – it sent out its very first email to the hair salon! This officially marks the halfway point for the goal of this project.
But it’s not without a little ‘technical’ humor.
It wasn’t without an issue. A rather funny one, as well. What do you see wrong here?

The observant of you will notice that an email sent on June 29 included a date range for the end of May into the first week of June. I was quickly informed of this error by the stylist:

Yes, my dates are indeed off a bit.
Then, it just got comical.

My assistant is certainly eager to get me in to see Mitch! That note was 6 hours after the first one, which we already saw was a bit wide of the mark. Now I’m just harassing those poor people.
NOTE: When I decided that I wanted to create a digital assistant, the primary reason for picking a hair appointment is that if something went off course it wouldn’t mean an accidental nuclear strike. At the least I’d get a funny story out of it and, well, here we are!
So what happened?
The date issue is rather silly; I forgot to account for the fact that Date.getMonth() is zero-based.
Issue 1: RESOLVED!
If the date issue was silly, then the bug I found while investigating the double email issue was a total, well, take it away Picard…

For those of you who code, this will be a fun exercise. Can you find my mistake?

That’s right! Line 71: “If there is no error, then let’s go ahead and reject this baby.”
This means that any time I did a lookup and there was no error, I was saying that there was. In doing so, I was not moving the History ID pointer that Google provides. At some point, the list function must have thrown an error, which allowed the function to resolve and send the second mail.
And yet, when I follow the execution flow there are two things that don’t fit this explanation:
- I move the History ID pointer before I make a call to get the most recent changes. This means that even if the getChange() method failed out, the history pointer should still be correct.
- Since I reject the call, it should have triggered a callback error. Looking through the logs, though, shows that every call was returned as ‘ok’.

Issue 2: INCONCLUSIVE
Overall, I’m pleased with today’s shakedown voyage.
What’s Next?
I thought you’d never ask! Now comes the really fun part of the project – getting my assistant to respond back.
After reviewing the Google Natural Language documentation I realize that this isn’t going to be as easy as I thought. Their documentation says that it can “extract information about people, places, events and much more,” (Emphasis added). I was under the impression that these were calendar events, but in my testing it seems that Google and I have different definitions as to what an “event” is.
This all means that I will most likely need to build out some logic around the entities and syntax maps (what Google provides back) that will extract my dates.
Or, if you know of something that I could use – library or otherwise – ping me and let me know. While I’m not opposed to giving it a go myself, just for the fun of learning how to do it, I am in no way a computational linguistics expert!
Thanks for visiting!
I’ve had a blast both working on this digital assistant and sharing the behind-the-scenes with you. If you’ve also enjoyed it, then join my mailing list and I’ll send email you my latest post.