Summary
During the review of PR #10816 (#10816), a suggestion was made to improve observability in ChangeTracker.deactivate() when it is called on an inactive tracker.
Currently, the method only logs a warn via loglevel when isActiveTracker(this) is false. Two enhancements were proposed:
Proposed Changes
1. DEV-mode assertion (throws)
In DEV builds, instead of silently warning, throw an assertion error to surface lifecycle mis-ordering early during development:
if (import.meta.env.DEV) {
console.assert(isActiveTracker(this), 'deactivate() called on inactive tracker:', this.workflow.path)
}
2. DESKTOP Sentry monitoring
On Desktop (where Sentry is enabled), capture a Sentry event with a tag so occurrence frequency can be tracked over time. After ~1 month of data, decide whether to file a bug or close it:
if (isDesktop) {
Sentry.captureEvent({
message: 'ChangeTracker.deactivate() called on inactive tracker',
tags: { workflow: this.workflow.path }
})
}
File
src/scripts/changeTracker.ts — ChangeTracker.deactivate()
References
Requested by @christian-byrne. Issue created by @coderabbitai at the request of @jaeone94.
┆Issue is synchronized with this Notion page by Unito
Summary
During the review of PR #10816 (#10816), a suggestion was made to improve observability in
ChangeTracker.deactivate()when it is called on an inactive tracker.Currently, the method only logs a
warnvialoglevelwhenisActiveTracker(this)is false. Two enhancements were proposed:Proposed Changes
1. DEV-mode assertion (throws)
In DEV builds, instead of silently warning, throw an assertion error to surface lifecycle mis-ordering early during development:
2. DESKTOP Sentry monitoring
On Desktop (where Sentry is enabled), capture a Sentry event with a tag so occurrence frequency can be tracked over time. After ~1 month of data, decide whether to file a bug or close it:
File
src/scripts/changeTracker.ts—ChangeTracker.deactivate()References
Requested by @christian-byrne. Issue created by @coderabbitai at the request of @jaeone94.
┆Issue is synchronized with this Notion page by Unito