Explaining the hack I put in
authorEd Page <eopage@byu.net>
Wed, 27 Jan 2010 03:18:45 +0000 (21:18 -0600)
committerEd Page <eopage@byu.net>
Wed, 27 Jan 2010 03:18:45 +0000 (21:18 -0600)
src/gvoice/conversations.py

index e5d71fe..7fbe1ca 100644 (file)
@@ -115,6 +115,11 @@ class MergedConversations(object):
                        self._remove_repeats(similarConversation, newConversation)
                        similarExist = True
                if similarExist:
                        self._remove_repeats(similarConversation, newConversation)
                        similarExist = True
                if similarExist:
+                       # Hack to reduce a race window with GV marking messages as read
+                       # because it thinks we replied when really we replied to the
+                       # previous message.  Clients of this code are expected to handle
+                       # this gracefully.  Other race conditions may exist but clients are
+                       # responsible for them
                        if newConversation.messages:
                                newConversation.isRead = False
                        else:
                        if newConversation.messages:
                                newConversation.isRead = False
                        else: