Skip to content

v2.3.0 - Production-Safe Defaults

Choose a tag to compare

@vietnguyentuan2019 vietnguyentuan2019 released this 21 Jan 12:10
· 123 commits to main since this release

Production-Safe Defaults - Auto-cleanup enabled by default to prevent memory leaks.

πŸ›‘οΈ Breaking Change (Behavior)

IMPORTANT: Auto-cleanup is now enabled by default to prevent memory leaks with dynamic IDs.

  • Old behavior: limiterAutoCleanupTTL defaulted to null (disabled)
  • New behavior: limiterAutoCleanupTTL defaults to Duration(minutes: 10) (enabled)

Impact:

  • βœ… No code changes needed for most apps
  • βœ… Apps using dynamic IDs are now safer by default
  • βœ… Limiters unused for 10+ minutes are auto-removed when count exceeds 100
  • βœ… Actively used limiters are never cleaned up

Migration:

// To keep old behavior (disable auto-cleanup):
DebounceThrottleConfig.init(
  limiterAutoCleanupTTL: null,  // Explicitly disable
);

πŸ“¦ What Changed

  • Default limiterAutoCleanupTTL: null β†’ Duration(minutes: 10)
  • Updated documentation to reflect new defaults
  • Added tests for default behavior
  • Enhanced examples to show auto-cleanup is enabled by default

🎯 Why This Change?

Memory leaks with dynamic IDs can cause production crashes. Making auto-cleanup the default ensures apps are safe by default, following the principle of "secure by default."