HomePhabricator

Fix NPE in ChangeDetailFactory for loadMessages isPatchVisible

Description

Fix NPE in ChangeDetailFactory for loadMessages isPatchVisible

If the patch set wasn't loaded from the database don't load its
associated messages. This can happen as a race condition where:

reader (T1):

scans patch sets

writer (T2):

 inserts new patch set
 inserts new message

reader (T1):
  scans messages

The reader doesn't know about the new patch set and cannot
validate if it is a draft or not. Since the reader is under
the assumption the patch set does not exist simply skipping
newer messages is sane.

Change-Id: Ifd2000364bcf6ce8f37935bd8c4cc1725fb52a64

Details

Provenance
Shawn Pearce <sop@google.com>Authored on Oct 8 2013, 12:19 AM
Parents
rGERRITDEPLOY02818e670389: Fix bad import of Project.NameKey
Branches
Unknown
Tags
Unknown
ChangeId
Ifd2000364bcf6ce8f37935bd8c4cc1725fb52a64

Event Timeline