Sessions QR Code Can Fail After Update Due To UUID
Contrary to what users expect, QR code authentication sessions in Home Assistant’s Pronote integration don’t always survive updates cleanly - after a refresh or restart, session data can go haywire. The root issue lies in a subtle divergence between uuid and qr_code_uuid. While the system uses both identifiers during a scan, the reconnection logic often rebuilds on qr_code_uuid alone, ignoring the refreshed uuid stored earlier. This mismatch breaks the sync.
- The coordinator relies solely on
qr_code_uuidto rebuild the session token, even whenuuidhas been updated. - A restart triggers a fresh login attempt with outdated identifiers, leading to failed reconnections.
- Updates to the Pronote component without unified UUID handling create a ticking compatibility gap.
Beyond the code, this reveals a deeper cultural habit: users trust QR-based systems as seamless, but behind the scenes, subtle state conflicts undermine reliability. This isn’t just a bug - it’s a reminder that trusted flows need resilient design.
Why does this happen? Because the UUID isn’t treated as the canonical truth. The fix starts with aligning reconstruction logic: prioritize the latest uuid, sync qr_code_uuid at export, and build a single source of truth. When updates occur, consistency is key.
The Bottom Line: QR code sessions break after updates because identity fields diverge - don’t trust the scan alone. When syncing session data, always validate the primary UUID first. Home Assistant users should verify re-scans work after restarts - because seamless shouldn’t mean fragile.