The problem was that upon login we immediately broadcast our client as being ONLINE, even before we setup an inbox for each friend to write to. This means that friends can send us instance messages before we have an inbox setup for them.
Previously, when creating an inbox for a friend, we cleared any existing data for that friend. Now we still create an inbox at the same time, but don't initialize it to empty. This ensures that messages received before the inbox is created can still be read.
Fix race condition where instance messages were lost. Fixes https://github.com/uProxy/uproxy/issues/1298
The problem was that upon login we immediately broadcast our client as being ONLINE, even before we setup an inbox for each friend to write to. This means that friends can send us instance messages before we have an inbox setup for them.
Previously, when creating an inbox for a friend, we cleared any existing data for that friend. Now we still create an inbox at the same time, but don't initialize it to empty. This ensures that messages received before the inbox is created can still be read.
Tested in uProxy using Facebook social provider