So you get to the final part of the story and it looks to be a bittersweet conclusion. Even though the big bad is gone, in the process some of your favorite characters died or suffered a mortal wound. Nonetheless, the remaining protagonists that are still standing will keep on living, forever carrying the legacy of their fallen comrades with them in their hearts...

...and then the deus ex machina of plot convenience shows up and it turns out that you can actually save them and no one actually needs to die. Maybe it's been foreshadowed, maybe it came straight out of the writer's asses, but whatever, hooray happy endings for everyone!

What's your thoughts on when a story has a fakeout bittersweet ending and then turns around and has a full-on happy ending after all? Do you just feel happy for the characters, or do you feel betrayed? Which stories did this well, which did it poorly?