Exercise 3: State Sync Race Condition

Exercise 3: State Sync Race Condition

animation
ux
interaction-patterns
NoteTry It Yourself

Hands-on exercises to reinforce interaction pattern concepts:

Exercise 3: State Sync Race Condition

Create a multi-client simulation:

  1. Open the Wokwi ESP32 MQTT simulator in two browser tabs
  2. Both tabs subscribe to home/thermostat/temperature topic
  3. Both tabs publish temperature changes simultaneously
  4. Observe last-write-wins behavior

What to observe: Which client’s change “wins”? Notice how timestamp resolution affects conflict detection. See what happens if clocks are skewed between clients.

Back to the chapter