It's pretty common to talk about edge cases in software, but we don't often think about them in embedded systems. This week, I found one in an elevator.
The hotel I was staying at requires guests to tap their key card after 5:00 p.m in the elevator, so they can access their floor. I stepped into the elevator at 4:59, pressed 7, and the elevator started moving.
Suddenly, it stopped at the fourth floor and the doors didn't open. It was exactly 5:00 p.m. The elevator refused to continue its journey until I tapped my key card and selected the seventh floor again.
From a security perspective, I can see the reasoning. The policy says that after 5:00 p.m., access to guest floors requires authentication. But from a systems perspective, it's an interesting edge case. The trip had already been authorized before the policy changed. Should the elevator honor the request that was already in progress, or should it re-evaluate permissions every time it changes floor?
How would you have implemented it?