p0 always needs to refer to the root-level comment.  when parent_ids.length is 0, it means self is the top level comment, so we populate it manually - otherwise we can copy all the values from parent_ids.