The reason people get bored is because your story strayed too far from the promised "goal" of your story, lack of change in the status-quo, and your character becomes stale due to stagnant/bad character development. The solution I think, is to plan multiple unique characters that have a really interesting character arc-- they do things, face consequences, and change because of it. Everything that they do also leads back toward a central goal.
A great example is Game of Thrones show (I havent read the book). The early story is massive with ton of characters but you're captivated because every character has a clear goal that intersect with one another, leading to conflicts. None of the conflicts are filler; they all fundamentally change the characters involved in some ways. Massive status quo changes happens regularly, altering path of the characters. Compare that to the later seasons of the show which lost its focus due to bad/rushed writing-- fan favorites always get away with bad decisions and never grow from it, none of the characters development make sense, and by the end, the status quo remained the same.
I actually hate it when the characters sidetrack from the issue or do something totally unrelated. I think everything they do need to end up connecting to both the character development and end goal.
I also don't like drawn out action scene unless a lot of stakes relating to the goal is involved.