Skip to content

Reject non-finite OOSM lag windows#4389

Merged
FlorianPfaff merged 2 commits into
mainfrom
agent/reject-nonfinite-oosm-max-lag-20260714
Jul 14, 2026
Merged

Reject non-finite OOSM lag windows#4389
FlorianPfaff merged 2 commits into
mainfrom
agent/reject-nonfinite-oosm-max-lag-20260714

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Owner

Summary

  • validate optional fixed-lag windows through one shared coercion helper
  • reject NaN and positive/negative infinity in both buffer and replay-updater constructors
  • add a regression across FixedLagBuffer, MeasurementTimeBuffer, and OutOfSequenceParticleUpdater

Root cause

FixedLagBuffer and _EventReplayMixin converted max_lag with float() and only checked whether the result was negative. NaN passes that comparison. In FixedLagBuffer._trim(), the resulting cutoff is NaN, so every item.time >= cutoff_time comparison is false and an append silently empties the buffer. The replay wrapper likewise receives invalid window comparisons and trimming behavior.

Impact

A non-finite lag configuration no longer produces silent data loss or invalid replay-window decisions. None remains the supported unlimited-window setting, and finite nonnegative values retain their existing behavior.

Validation

  • reproduced the old NaN cutoff behavior in isolation
  • exercised the shared coercion helper against NaN, both infinities, negative values, overflow-sized integers, None, zero, and finite positive values
  • compared the branch with main: two files changed, 14 production additions / 6 deletions, plus one focused 37-line regression
  • full repository and backend validation is delegated to GitHub Actions

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 25.2s
✅ JSON prettier 7 0 0 0 1.21s
✅ JSON v8r 7 0 0 4.89s
✅ MARKDOWN markdownlint 68 0 0 0 1.91s
✅ MARKDOWN markdown-table-formatter 68 0 0 0 0.73s
✅ PYTHON black 1490 183 0 0 97.22s
✅ PYTHON isort 1490 328 0 0 2.66s
✅ REPOSITORY betterleaks yes no no 2.6s
✅ REPOSITORY checkov yes no no 55.55s
✅ REPOSITORY gitleaks yes no no 15.04s
✅ REPOSITORY git_diff yes no no 0.4s
✅ REPOSITORY secretlint yes no no 64.56s
✅ REPOSITORY syft yes no no 6.28s
✅ REPOSITORY trivy-sbom yes no no 7.42s
✅ REPOSITORY trufflehog yes no no 32.43s
✅ YAML prettier 11 0 0 0 0.77s
✅ YAML v8r 11 0 0 12.77s
✅ YAML yamllint 11 0 0 0.64s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.6.0 --custom-flavor-setup --custom-flavor-linters PYTHON_BLACK,PYTHON_ISORT,COPYPASTE_JSCPD,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_BETTERLEAKS,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@FlorianPfaff FlorianPfaff marked this pull request as ready for review July 14, 2026 20:17
@FlorianPfaff FlorianPfaff merged commit 12e6e78 into main Jul 14, 2026
26 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.

1 participant