Skip to content

Record every day of an event batch in IOC.days_seen. Closes #1814 - #1840

Merged
regulartim merged 1 commit into
GreedyBear-Project:developfrom
Akshats-git:fix/days-seen-multiday-batches
Nov 11, 2026
Merged

regulartim merged 1 commit into
GreedyBear-Project:developfrom
Akshats-git:fix/days-seen-multiday-batches

Conversation

@Akshats-git

@Akshats-git Akshats-git commented Nov 7, 2026 •

Copy link
Copy Markdown

Description

An Event Collector batch can cover several days, but only the date of the latest event was added to IOC.days_seen. The other days were lost.

This PR fixes that in two places:

  • iocs_from_hits now puts the distinct days of all hit timestamps on the new IOC.
  • IocProcessor._merge_iocs merges those days into the stored days_seen (sorted, no duplicates).

_update_days_seen stays as the last step. This also covers late uploads, where older events arrive after newer ones. T-Pot is not affected: its windows never span two days, so it still records one day.

No migration is needed.

Related issues

Closes #1814

AI disclosure

Used Claude to help with the code and the tests. I reviewed all of it and ran the full test suite myself.

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Chore (refactoring, dependency updates, CI/CD changes, code cleanup, docs-only changes).

Checklist

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I have read and understood the AI policy.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop.
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.
  • I am interested in participating in GSoC.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behavior that is described in the wiki. If so, I also included an update to the wiki in the description of this PR. (The wiki only describes the min_days_seen filter, which does not change.)
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

GUI changes

Not applicable, no GUI changes.

…r-Project#1814

iocs_from_hits now collects the distinct days of all hit timestamps
and _merge_iocs merges them into the stored days_seen. Before, only
the date of the latest event was recorded, so batches that span
several days (or late uploads) lost days.
Copilot AI balanced review requested due to automatic review settings November 7, 2026 15: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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Akshats-git

Akshats-git commented Nov 7, 2026 •

Copy link
Copy Markdown
Author

Hi @regulartim . Missed the AI Policy note before raising this PR so it has llm usage. Will keep it in mind from next time.

@regulartim

Copy link
Copy Markdown
Member

Hey @Akshats-git !

Missed the AI Policy note before raising this PR so it has llm usage. Will keep it in mind from next time.

That's fair, I appreciate your honesty! :)

@regulartim regulartim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice and correct fix, thanks for your work! :) I'll merge once CI is green.

@regulartim
regulartim merged commit d761756 into GreedyBear-Project:develop Nov 11, 2026
8 checks passed
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