Skip to content

Reject articles with duplicate Date headers - #210

Merged
enteriaza merged 1 commit into
masterfrom
165-bug-article-a-later-date-header-can-disagree-with-the-stored-date-field
Oct 19, 2026
Merged

enteriaza merged 1 commit into
masterfrom
165-bug-article-a-later-date-header-can-disagree-with-the-stored-date-field

Conversation

@enteriaza

@enteriaza enteriaza commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #165

Reject NNTP articles containing multiple Date headers before date resolution, preventing CanonicalUtc from disagreeing with the Date field retained for overview and transfer.

Changes

  • Add NntpArticleParseFailureCode.DuplicateDate.
  • Detect duplicate Date headers before invoking ArticleDateHeaderResolver.
  • Reject duplicate headers regardless of whether their values are valid, invalid, or represent the same instant.
  • Handle header names case-insensitively and cover folded headers.
  • Preserve existing behavior for a single Date header, including fallback to Injection-Date and other candidate names when applicable.
  • Document the single-Date requirement and rejection behavior.
  • Add regression tests covering duplicate dates, malformed values, case variations, folded headers, and downstream canonicalization consistency.

Validation

  • Focused parser, field-table, materializer, and transfer tests — 180 passed
  • VectorNNTPD.Common.Tests — 913 passed
  • VectorNNTPD.BackFillerService.Tests — 1,266 passed
  • Release x64 solution build — 0 warnings, 0 errors
  • dotnet format VectorNNTPD.slnx --verify-no-changes — passed
  • Local CodeQL analysis — no findings in the changed files

Note: These validation results were reported before the final read-only audit; that audit did not rerun the checks. Local CodeQL results do not replace GitHub code scanning.

Compatibility

Articles containing duplicate Date headers are now rejected, even if both values are valid or represent the same instant. Articles with a single Date header retain their existing behavior.

The duplicate check runs before canonical date resolution and materialization, preventing an accepted article from publishing a canonical timestamp derived from a different header occurrence than the one stored for downstream processing.

Fixes #165

Enforce the RFC 5536 single-Date requirement before date
resolution, preventing CanonicalUtc from disagreeing with
the Date field retained for overview and transfer. Add
regression coverage for duplicate and malformed Date headers.
@enteriaza enteriaza self-assigned this Oct 19, 2026
@enteriaza enteriaza added the bug Something isn't working label Oct 19, 2026
@enteriaza
enteriaza merged commit 937a7b6 into master Oct 19, 2026
7 checks passed
@enteriaza
enteriaza deleted the 165-bug-article-a-later-date-header-can-disagree-with-the-stored-date-field branch October 19, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug: Article] A later Date header can disagree with the stored Date field

1 participant