Blog post search stack bug
When you type a character into the blog post search bar, the results will automatically filter based on what you have typed so far. As long as you let this search complete before you type in the next character, everything will work as expected.
However, if you type faster than the results are returned, you will see the desired results flash for a second, and then each second after that, you will see the results change and the number of pages in the results get progressively larger.
It seems like, when a search is interrupted by a new character being typed, that search is pushed onto some sort of stack, and so when you are finally done typing all of the characters, you get your desired result, but then the next search in the stack is popped and executed, and this is repeated for all items in the stack. The last search to be executed is the first search that was pushed onto the stack, but this one is the least specific.
I don't know whose idea it was to use a stack for this. A queue would have been better, but even that is unnecessary. There shouldn't be any need to save old search terms. Just worry about what is in the search box at the current moment and cancel any searches that are currently running.
