Commit 8f7214f
committed
fix: don't re-fire the same Splitwise notification event every poll
The splitwise library's getNotifications() accepts updated_since/limit
params but never actually applies them (unimplemented upstream) - every
poll re-fetches the same "recent notifications" window regardless of
what was already seen. Without dedup, the same notification would fire
its splitwise_notification_event_* bus event again every SCAN_INTERVAL
for as long as it stayed in that window, not just once when it appeared.
Track notification ids seen on the previous poll and only fire events
for ones not seen before. Note: this is in-memory only, so a HA restart
still causes one re-fire of whatever's currently in the recent window.1 parent e465b89 commit 8f7214f
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
190 | 196 | | |
191 | 197 | | |
192 | 198 | | |
193 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
194 | 205 | | |
195 | 206 | | |
196 | 207 | | |
| |||
209 | 220 | | |
210 | 221 | | |
211 | 222 | | |
| 223 | + | |
| 224 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
0 commit comments