socket.io sync state across sockets

I'm creating a board game where 2 players can play, and others can be spectators (viewers) so, when a spectator joins, he gets the current state of the game, and from then on, he only gets the move each player has made (to save data obviously).

My question is: when the spectator first get the state of the game from the server, how can I make sure it is actually synced? I don't really know when he will get the state, and it might be a fraction of a second before something has changed, and then the Delta he gets for every move made won't make sense.

Should I use some kind of an internal? what would you suggest to make sure everything is synced?

Assuming that your state is result of, and only of, user actions, you could store you state in a table like format with an auto-increment integer ID.

In the move event, you pass the new ID and the previous ID. If the receiver's max ID is less than the previous ID, you know to ask server for the missing actions.