[PATCH] Fix parsing of un-numbered messages in series

Stephen Fincane stephen at that.guru
Fri Nov 18 12:03:05 AEDT 2016

On Wed, 2016-11-16 at 16:58 +1100, Daniel Axtens wrote:
> Say we are sent the following:
>           - [PATCH 0/2] A sample series
>             - [PATCH 1/2] test: Add some lorem ipsum
>             - Random message with diff
> We expect that:
>  1) we parse normally without errors
>  2) we get a series with a cover letter and a patch
>  3) the random message is orphaned
> What happens is that we get an integrity error, boiling down to:
> (1048, "Column 'number' cannot be null")
> This is caused because we believe that the random message belongs
> to the series because of the headers, but because there are no
> numbers in the Subject, we pass "None" into the number field of
> SeriesPatch. That turns into a null, and rightly hits an integrity
> error.
> Fix this by requring that a message has a series _and_ a number
> before we try to add it to the series.
> Add a test to verify correctness.
> Reported-by: Daniel Wagner <wagi at monom.org>
> Signed-off-by: Daniel Axtens <dja at axtens.net>

Looks good to me. Appreciate the sanity check test.

Reviewed-by: Stephen Finucane <stephen at that.guru>

...and applied.	

More information about the Patchwork mailing list