Skip to content

fix publish queue processing time for corrections - #3291

Merged
petrjasek merged 1 commit into
superdesk:developfrom
petrjasek:fix-lifecycle-timing-corrections
Aug 24, 2026
Merged

petrjasek merged 1 commit into
superdesk:developfrom
petrjasek:fix-lifecycle-timing-corrections

Conversation

@petrjasek

Copy link
Copy Markdown
Member

it shows time since first publishing instead of the time since the correction was published.

SDESK-7979

Purpose

What has changed

Steps to test

Resolves: #[issue-number]

it shows time since first publishing instead of the time
since the correction was published.

SDESK-7979
Copilot AI lite review requested due to automatic review settings August 21, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates publish queue timing so corrections measure from the correction publication rather than the original publication.

Changes:

  • Reset lifecycle timestamps for subsequent publish actions.
  • Add regression coverage for correction timing.
  • Resend actions still bypass the reset path and require adjustment.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Summary
tests/archive/archive_test.py Adds regression coverage for correction lifecycle timing.
apps/publish/content/common.py Resets lifecycle timing, but resend requests do not currently use this reset path.
Suppressed comments (1)

tests/archive/archive_test.py:434

  • This regression test only checks the archive document. It does not verify the user-visible publish-queue timing (lifecycle_started_ms / lifecycle_to_transmit_ms), so it would still pass if the reset were lost while constructing the PublishRequest or queue item. Please exercise the correction's queue entry and assert that its lifecycle start and calculated transmit duration use correction_at.
        correction_at = first_publish_at + timedelta(hours=5)
        with mock.patch.object(common, "utcnow", lambda **kwargs: correction_at):
            await correct_service.patch_async("foo-correct", {"body_html": "corrected"})

        corrected = self.app.data.find_one("archive", req=None, _id="foo-correct")
        # firstpublished must be untouched, but lifecycle timing restarts for this correction
        self.assertEqual(first_publish_at, corrected["firstpublished"])
        self.assertEqual(correction_at, corrected["lifecycle_timing"]["lifecycle_started_at"])

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps/publish/content/common.py
@petrjasek
petrjasek merged commit b6efac8 into superdesk:develop Aug 24, 2026
13 checks passed
@petrjasek
petrjasek deleted the fix-lifecycle-timing-corrections branch August 24, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants