Telemetry baseline: session tracking and UI-framework marker#987
Telemetry baseline: session tracking and UI-framework marker#987johnml1135 wants to merge 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
c2b97ca to
f5b9386
Compare
Code review (verified against the code at the PR head)This is a large, unusually well-documented change ( HIGH — orphan-recovery path skips the network-availability check, so a stale
|
|
Fixed the HIGH issue in b98e841: added the same While verifying that fix, stress-testing (10 runs) turned up a second, real bug in the same file: Added Also verified the minor point re: |
This comment has been minimized.
This comment has been minimized.
|
(Follow-up: trimmed the two comments from the fix above down to one line each, per repo convention.) |
3a59a1c to
77ce5a6
Compare
This comment has been minimized.
This comment has been minimized.
Instrument a legacy WinForms usage/crash/session baseline for a future
Avalonia UI migration to compare against. Events go through
DesktopAnalytics.Analytics directly; offline durability is the
SIL.DesktopAnalytics library's job, not FieldWorks' (design D4).
- Session baseline: SessionStart/SessionEnd with a per-launch SessionId
and clean-vs-crashed classification, guarded so exactly one terminal
event fires per session (session duration, crash-free rate).
- UiFramework marker: SetApplicationProperty("UiFramework", "WinForms")
once at startup, a forward-compatible constant a future Avalonia
surface flips per-surface without changing how events are tracked.
- SwitchToTool dwell time: the throttled event now carries time spent in
the previous tool, plus a final record at shutdown.
Also adds local DesktopAnalytics.net iteration tooling
(Manage-LocalLibraries.ps1) and two offline-durability smoke tests for
the library's Mixpanel spool. openspec: telemetry-migration-baseline.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
c286887 to
b5f17ad
Compare
Summary
Establishes a WinForms telemetry baseline (openspec change
telemetry-migration-baseline) ahead of the Avalonia UI migration, so there isa legacy usage/crash/session baseline to compare against later. All events go
through
DesktopAnalytics.Analyticsdirectly.SessionStart/SessionEndwith a per-launchSessionIdand clean-vs-crashed classification, guarded so exactly oneterminal event fires per session (gives session duration and crash-free rate).
UiFrameworkmarker —SetApplicationProperty("UiFramework", "WinForms")once at startup; a forward-compatible constant a future Avalonia surface flips
per-surface, with no change to how events are tracked.
SwitchToTooldwell time — the existing throttled event now carries thetime spent in the previous tool, plus a final record at shutdown.
Offline durability lives in the library, not here
Making analytics durable when Mixpanel is unreachable (on-disk spool, retry, a
real per-event delivery ack,
$insert_iddedup, consent purge) is owned by theSIL.DesktopAnalyticslibrary's durableMixpanelClient(sillsdev/DesktopAnalytics.net#43), so FieldWorks carries no queueing code and
inherits durability from a version bump. Until that release, offline-generated
events are delivered best-effort exactly as today — an accepted, temporary gap.
This PR also adds local-checkout iteration tooling (
Build/Manage-LocalLibraries.ps1 -DesktopAnalytics) and two smoke tests that validate that library's spool directly.Testing
.\build.ps1green (0 warnings, 0 errors)..\test.ps1on the affectedprojects with no regressions vs.
main:FwUtilsTests375/375,LexTextDllTests3/3,FieldWorksTests34/34 (1 pre-existing skip).FieldWorks launch (see
Docs/architecture/local-library-debugging.md):Test-AnalyticsOfflineDrain.ps1(per-process firewall block —accumulate-then-drain across processes) and
Test-AnalyticsOfflineSandbox.ps1(Windows Sandbox, no NIC — born-offline, never falsely acked). Both pass as of
2026-07-09.
Mixpanel with
UiFramework=WinFormsand that the privacy checkbox still gatestelemetry (
tasks.md§4.3); session and dwell logic have no automated test(
tasks.md§2.6/§3.4).External prerequisite
Release the durable
SIL.DesktopAnalytics(sillsdev/DesktopAnalytics.net#43),then bump
SilDesktopAnalyticsVersioninBuild/SilVersions.props(
tasks.md§5). No other FieldWorks change is needed for offline durability;the baseline instrumentation itself does not depend on that release.
This change is