Skip to content

fix: the weekly data anomaly detection was broken for the Svelte anomalies#1983

Merged
graphieros merged 2 commits intonpmx-dev:mainfrom
samal-rasmussen:fix-weekly-data-anomalies
Mar 8, 2026
Merged

fix: the weekly data anomaly detection was broken for the Svelte anomalies#1983
graphieros merged 2 commits intonpmx-dev:mainfrom
samal-rasmussen:fix-weekly-data-anomalies

Conversation

@samal-rasmussen
Copy link
Contributor

The weekly data anomaly detection was broken for the Svelte anomalies

🔗 Linked issue

Follow up to PR: #1934

📚 Description

The previous code was being a bit too naive about weekly range data anomaly detection, and so wasn't including all the affected weeks properly. You actually have to check the weekly range.

Was broken for the Svelte data anomalies.
@vercel
Copy link

vercel bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 7, 2026 11:25pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 7, 2026 11:25pm
npmx-lunaria Ignored Ignored Mar 7, 2026 11:25pm

Request Review

@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/utils/download-anomalies.ts 0.00% 6 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@samal-rasmussen samal-rasmussen changed the title fix: The weekly data anomaly detection was broken for the Svelte anomalies fix: the weekly data anomaly detection was broken for the Svelte anomalies Mar 7, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0017bc76-f2b3-447f-b76c-c588ebc094f2

📥 Commits

Reviewing files that changed from the base of the PR and between 0d952fa and 9bf8ef0.

📒 Files selected for processing (2)
  • app/utils/download-anomalies.ts
  • test/unit/app/utils/download-anomalies.spec.ts

📝 Walkthrough

Walkthrough

This pull request modifies the weekly anomaly detection logic in app/utils/download-anomalies.ts by replacing the simple date equality check with a full seven-day week window overlap calculation. The function now returns true when a date falls within any week that intersects the anomaly range, whilst daily, monthly, and yearly granularities remain unchanged. A new unit test is added to validate the applyBlocklistCorrection function with weekly data, ensuring overlapping buckets are correctly marked as anomalies with adjusted interpolated values.

Possibly related PRs

Suggested reviewers

  • graphieros
  • alexdln
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly explains the bug fix for weekly data anomaly detection and references the related PR, aligning with the changeset modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@graphieros graphieros left a comment

Choose a reason for hiding this comment

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

Looks good to me, as it catches full & partial weekly overlaps.
And thanks for the test :)

@graphieros graphieros added this pull request to the merge queue Mar 8, 2026
Merged via the queue into npmx-dev:main with commit ed7f8f2 Mar 8, 2026
20 checks passed
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

Thanks for your first contribution, @samal-rasmussen! 🤩

We'd love to welcome you to the npmx community. Come and say hi on Discord! And once you've joined, visit npmx.wamellow.com to claim the contributor role.

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