Desktop Filter not working when changing desktops at runtime

[] [] [] [] [] [] [] [] []

Symptom
Relevant release:
NW04S SP14 and up (When Desktop Filter Feature First Exposed).
When using the Desktop Filter Feature and changing desktops at runtime (for example changing the URL alias from /portal to /portal/light ), the desktop might not be switched correctly and the user might not receive the relevant roles.
Other terms
Desktop Filter, Filtering, Entry Point, [...]