Skip to content

Use fixed 89-day window for run_checks#231

Merged
erayaydin merged 1 commit into
mainfrom
fix/use-fixed-89-day-checks
Jun 22, 2026
Merged

Use fixed 89-day window for run_checks#231
erayaydin merged 1 commit into
mainfrom
fix/use-fixed-89-day-checks

Conversation

@erayaydin

Copy link
Copy Markdown
Member

Problem

run_checks.php calculated the searchEvents start time using a 3-month (P3M) interval. Because PHP's DateInterval with months is calendar-based, this can resolve to 89+ days depending on which months are spanned/included.

The Fingerprint API rejects start times older than 90 days, so the check script would fail.

Fix

Replace P3M with P89D to use a fixed 89-day window, which always stays within the API limit regardless of the calendar month.

The start time for `searchEvents` was calculated using a
**3-month interval** (`P3M`), which is calendar-based and can
resolve to 80+ days depending on which months are involved.

The Fingerprint API rejects start times older than 90 days,
causing the `run_checks.php` script to fail when 3 calendar
months exceeded that threshold.

Replaced `P3M` with `P89D` to use a fixed 89-day window that
always stays within the API limit.
@erayaydin erayaydin requested a review from Copilot June 21, 2026 14:55
@erayaydin erayaydin self-assigned this Jun 21, 2026
@erayaydin erayaydin added the bug Something isn't working label Jun 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the run_checks.php script to use a fixed-day lookback window when calling searchEvents, ensuring the computed start time consistently stays within the Fingerprint API’s 90-day limit (avoiding calendar-month variability from P3M).

Changes:

  • Replace the calendar-based DateInterval('P3M') with a fixed DateInterval('P89D') for the searchEvents start time.

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

@github-actions

Copy link
Copy Markdown
Contributor

🟢 Coverage increased by 83.98%

Code Coverage Report

Coverage Report

St. Category Percentage Covered / Total
🟢 Statements 83.98% 3067 / 3652
🟢 Functions 82.18% 1213 / 1476
Files Coverage
St. File Methods Statements Total Coverage
🔴 src/Model/BotInfoCategory.php 0.00% 0.00% 0.00%
🔴 src/Model/BotInfoConfidence.php 0.00% 0.00% 0.00%
🔴 src/Model/BotInfoIdentity.php 0.00% 0.00% 0.00%
🔴 src/Model/BotResult.php 0.00% 0.00% 0.00%
🔴 src/Model/ErrorCode.php 0.00% 0.00% 0.00%
🔴 src/Model/IncrementalIdentificationStatus.php 0.00% 0.00% 0.00%
🔴 src/Model/ModelInterface.php 0.00% 0.00% 0.00%
🔴 src/Model/ProxyConfidence.php 0.00% 0.00% 0.00%
🔴 src/Model/RareDevicePercentileBucket.php 0.00% 0.00% 0.00%
🔴 src/Model/RuleActionType.php 0.00% 0.00% 0.00%
🔴 src/Model/SearchEventsBot.php 0.00% 0.00% 0.00%
🔴 src/Model/SearchEventsBotInfo.php 0.00% 0.00% 0.00%
🔴 src/Model/SearchEventsIncrementalIdentificationStatus.php 0.00% 0.00% 0.00%
🔴 src/Model/SearchEventsRareDevicePercentileBucket.php 0.00% 0.00% 0.00%
🔴 src/Model/SearchEventsSdkPlatform.php 0.00% 0.00% 0.00%
🔴 src/Model/SearchEventsVpnConfidence.php 0.00% 0.00% 0.00%
🔴 src/Model/TamperingConfidence.php 0.00% 0.00% 0.00%
🔴 src/Model/VpnConfidence.php 0.00% 0.00% 0.00%
🔴 src/Sealed/DecryptionAlgorithm.php 0.00% 0.00% 0.00%

@erayaydin erayaydin marked this pull request as ready for review June 21, 2026 14:57
@erayaydin erayaydin merged commit c7f80df into main Jun 22, 2026
17 checks passed
@erayaydin erayaydin deleted the fix/use-fixed-89-day-checks branch June 22, 2026 09:09
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.

3 participants