I would like to remove the 50pts of vertical space before the chapter when it is an appendix (leaving the default space for normal chapters). Here is a mwe
% !Mode:: "TeX:UTF-8"
\documentclass[a4paper,12pt,oneside]{book}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{titlesec}
\usepackage{appendix}
\begin{document}
\chapter{Normal chapter}
\chapter{Normal chapter}
\appendix
\chapter{Appendix chapter}
\chapter{Appendix chapter}
\end{document}
I tried to comment the space in the book class declaration by adding this in the preamble
%remove vspace before chapter
\makeatletter
\def\@makechapterhead#1{%
%\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
but doing so will remove the space for all chapters. Is it possible to add an if-else condition to the code to remove the space only if it is an appendix?

\appendixor add the code to the definition of appendix. First seems to be much easier for you right now Space before chapters and contents – Johannes_B Jun 25 '15 at 09:34