[PR #444] [MERGED] Fix/hms flapping notifications #1043

Closed
opened 2026-05-06 12:34:39 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/444
Author: @sbcrumb
Created: 2/18/2026
Status: Merged
Merged: 2/19/2026
Merged by: @maziggy

Base: 0.2.1bHead: fix/hms-flapping-notifications


📝 Commits (10+)

  • c2dff5f Debounce HMS error tracking to prevent flapping notifications
  • 1d0875e build(deps): bump aquasecurity/trivy-action
  • 5bcfadb Merge pull request #437 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58
  • 10cae70 Updated CI
  • 971aa96 build(deps): bump aquasecurity/trivy-action
  • 0a725c0 Merge pull request #440 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58
  • a361671 Updated CI
  • 036ae16 Updated CI
  • 2d5f7bb Merge branch 'maziggy:main' into fix/hms-flapping-notifications
  • 0f549f9 Merge branch '0.2.1b' into fix/hms-flapping-notifications

📊 Changes

1 file changed (+14 additions, -2 deletions)

View changed files

📝 backend/app/main.py (+14 -2)

📄 Description

Debounce HMS error tracking to prevent flapping notifications

Fixes #443

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

  • Added a 30-second grace period before clearing HMS notification tracking state
  • When hms: [] arrives, the tracking is preserved for 30 seconds instead of clearing immediately
  • If the same error reappears within the grace window, it is still marked as "already notified" and won't re-trigger
  • After 30 seconds of genuinely clear HMS, tracking resets so future occurrences notify normally

Screenshots

N/A

Testing

  • I have tested this on my local machine
  • I have tested with my printer model: H2S

Verified with MQTT debug logs that flapping HMS codes (e.g. chamber temp regulation
during PETG prints) only trigger a single notification per episode instead of
repeated notifications on each on/off cycle.

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

Additional Notes

Single file change (backend/app/main.py), 14 lines added / 2 removed. The fix
adds two module-level tracking variables (_hms_last_seen dict and
_HMS_CLEAR_GRACE_SECONDS constant) and updates the else branch of the HMS error
check to only clear tracking after the grace period has elapsed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/444 **Author:** [@sbcrumb](https://github.com/sbcrumb) **Created:** 2/18/2026 **Status:** ✅ Merged **Merged:** 2/19/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `0.2.1b` ← **Head:** `fix/hms-flapping-notifications` --- ### 📝 Commits (10+) - [`c2dff5f`](https://github.com/maziggy/bambuddy/commit/c2dff5fbb044ffd99a30dd772a8817d7922dd938) Debounce HMS error tracking to prevent flapping notifications - [`1d0875e`](https://github.com/maziggy/bambuddy/commit/1d0875ee83992e2b1e22afac06639717e384211d) build(deps): bump aquasecurity/trivy-action - [`5bcfadb`](https://github.com/maziggy/bambuddy/commit/5bcfadbd8d6457d9b12bceb0ec1c127aae8286eb) Merge pull request #437 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58 - [`10cae70`](https://github.com/maziggy/bambuddy/commit/10cae700f4702a6660baf66bdf8f673dc06f766d) Updated CI - [`971aa96`](https://github.com/maziggy/bambuddy/commit/971aa960a8280b414aac2077e91881f19fde40b0) build(deps): bump aquasecurity/trivy-action - [`0a725c0`](https://github.com/maziggy/bambuddy/commit/0a725c0ccc5744e1c1bd6fb14ea8a1dc2fcdace6) Merge pull request #440 from maziggy/dependabot/github_actions/dot-github/workflows/github_actions-9bddd90c58 - [`a361671`](https://github.com/maziggy/bambuddy/commit/a3616719526e6f9455742dcd59b6c1898ef50233) Updated CI - [`036ae16`](https://github.com/maziggy/bambuddy/commit/036ae16ad5511369bac94ab2a4f85169c817ec8f) Updated CI - [`2d5f7bb`](https://github.com/maziggy/bambuddy/commit/2d5f7bbffefd3674a2b901c524a1548839df8b7f) Merge branch 'maziggy:main' into fix/hms-flapping-notifications - [`0f549f9`](https://github.com/maziggy/bambuddy/commit/0f549f98093dc4169ee7ad8e14b43499e86c1e6d) Merge branch '0.2.1b' into fix/hms-flapping-notifications ### 📊 Changes **1 file changed** (+14 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/app/main.py` (+14 -2) </details> ### 📄 Description Debounce HMS error tracking to prevent flapping notifications ## Related Issue Fixes #443 ## Type of Change - [x] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Test addition or update ## Changes Made - Added a 30-second grace period before clearing HMS notification tracking state - When `hms: []` arrives, the tracking is preserved for 30 seconds instead of clearing immediately - If the same error reappears within the grace window, it is still marked as "already notified" and won't re-trigger - After 30 seconds of genuinely clear HMS, tracking resets so future occurrences notify normally ## Screenshots N/A ## Testing - [x] I have tested this on my local machine - [x] I have tested with my printer model: H2S Verified with MQTT debug logs that flapping HMS codes (e.g. chamber temp regulation during PETG prints) only trigger a single notification per episode instead of repeated notifications on each on/off cycle. ## Checklist - [x] My code follows the project's coding style - [x] I have commented my code where necessary - [ ] I have updated the documentation (if needed) - [x] My changes generate no new warnings - [x] I have tested my changes thoroughly ## Additional Notes Single file change (`backend/app/main.py`), 14 lines added / 2 removed. The fix adds two module-level tracking variables (`_hms_last_seen` dict and `_HMS_CLEAR_GRACE_SECONDS` constant) and updates the else branch of the HMS error check to only clear tracking after the grace period has elapsed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:34:39 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#1043
No description provided.