Skip to content

Conversation

@quanganhdo
Copy link
Member

@quanganhdo quanganhdo commented Nov 28, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1211997685068472?focus=true
Tech Design URL:
CC: @THISISDINOSAUR

Description

This bumps the next scan date to now() in case it’s connected to an overdue scan.

This affects the scanSchedule.nextScan.date value for maintenanceScanStatus.

Testing Steps

  1. CI passes

Impact and Risks

What could go wrong?

Quality Considerations

Notes to Reviewer


Internal references:

Definition of Done | Engineering Expectations | Tech Design Template


Note

Clamps the next scan date to the current time if the earliest preferred run date is in the past and adds a unit test to verify it.

  • Core:
    • Update getNextScansInformation in SharedPackages/DataBrokerProtectionCore/Sources/DataBrokerProtectionCore/UIWeb/DBPUICommunicationModelScanStateExtensions.swift to set nextScan.date using max(earliestScanPreferredRunDate, currentDate).
  • Tests:
    • Add testNextScans_whenPreferredRunDateIsInThePast_thenDisplayDateIsClampedToNow in SharedPackages/DataBrokerProtectionCore/Tests/DataBrokerProtectionCoreTests/DBPUICommunicationViewModelScanStateExtensionsTests.swift to assert nextScan.date >= now.

Written by Cursor Bugbot for commit ef3027c. This will update automatically on new commits. Configure here.

Copilot finished reviewing on behalf of quanganhdo November 28, 2025 18:11
Copy link
Contributor

Copilot AI left a comment

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 ensures that the next scan date displayed in the Personal Information Removal (PIR) feature is never shown as being in the past, which could occur when a scan is overdue.

Key changes:

  • Added logic to clamp the next scan display date to the current time when the preferred run date is in the past
  • Added a test to verify the date clamping behavior works correctly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
SharedPackages/DataBrokerProtectionCore/Sources/DataBrokerProtectionCore/UIWeb/DBPUICommunicationModelScanStateExtensions.swift Implemented date clamping logic using max() to ensure next scan date is never in the past
SharedPackages/DataBrokerProtectionCore/Tests/DataBrokerProtectionCoreTests/DBPUICommunicationViewModelScanStateExtensionsTests.swift Added test case to verify that past preferred run dates are correctly clamped to the current time

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants