LearnNewsExamplesServices
Frontmatter
id6956
titleEnhance `Neo.core.Config` with ID-based Subscriptions for Improved Debugging & Diagnostics
stateClosed
labels
enhancement
assigneestobiu
createdAtJul 6, 2025, 1:58 AM
updatedAtJul 6, 2025, 2:23 AM
githubUrlhttps://github.com/neomjs/neo/issues/6956
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 6, 2025, 2:23 AM

Enhance Neo.core.Config with ID-based Subscriptions for Improved Debugging & Diagnostics

Closed v10.0.0-beta.5 enhancement
tobiu
tobiu commented on Jul 6, 2025, 1:58 AM

Problem: Current Neo.core.Config subscriptions, especially with anonymous functions, lack clear ownership. This makes debugging challenging, as it's hard to identify which Neo.core.Base instance owns a specific subscription. This hinders memory leak detection and general application understanding.

Solution: Modify Neo.core.Config#subscribe to strictly require an id (representing the owner's ID) and a callback fn. Subscriptions will be stored in an internal map (id -> Set<fn>).

Benefits:

  • Enhanced Debugging: Easily inspect Config#subscribers to see which Neo.core.Base instances are listening to a config, aiding in understanding data flow.
  • Improved Diagnostics: Provides a crucial diagnostic tool for tracing memory leaks or unintended subscriptions back to their source instance.
  • Future-Proofing: Lays the groundwork for more advanced subscription management tools and visualizations.

Impact: Requires updates to Neo.core.Base#observeConfig and any other direct consumers of Neo.core.Config#subscribe to conform to the new signature.

tobiu assigned to @tobiu on Jul 6, 2025, 1:58 AM
tobiu added the enhancement label on Jul 6, 2025, 1:58 AM
tobiu referenced in commit 542e84b - "Enhance Neo.core.Config with ID-based Subscriptions for Improved Debugging & Diagnostics #6956" on Jul 6, 2025, 2:00 AM
tobiu referenced in commit 1ee7782 - "#6956 core.Config cleanup" on Jul 6, 2025, 2:12 AM
tobiu closed this issue on Jul 6, 2025, 2:23 AM