Use persistence MongoDB, but there is a problem subscriptions

I used the DEMO offline mode code.
It worked well the first time.
But when I reload the page, subscriptions collection will insert a new record.
So the same clientId has two records in subscriptions collection.
Now I publish a message and connect client, we will get two offline messages.
What's wrong with me?
Thank you.