custom-components / healthchecksio

Update and display the status of your healthchecks.io checks.
MIT License
48 stars 9 forks source link

Fix potential mutable dict issue #44

Closed Snuffy2 closed 8 months ago

Snuffy2 commented 11 months ago

Function defaults are evaluated once, when the function is defined.

The same mutable object is then shared across all calls to the function. If the object is modified, those modifications will persist across calls, which can lead to unexpected behavior.

Instead, prefer to use immutable data structures, or take None as a default, and initialize a new mutable object inside the function body for each call.