Skip to content

chore(analytics): drop the browser example.saved fallback - #387

Merged
demtario merged 1 commit into
masterfrom
chore/remove-browser-example-saved-fallback
Sep 30, 2026
Merged

demtario merged 1 commit into
masterfrom
chore/remove-browser-example-saved-fallback

Conversation

@demtario

@demtario demtario commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Context

The API worker writes the example.saved Analytics Engine point on every successful Save rebuild and every rebuild response carries exampleSaved: boolean. The editor still counted a Save itself when a response lacked that key (browserCountsSave), a fallback for an API that predates the marker. This PR removes the fallback so the API is the only emitter of example.saved. It removes browserCountsSave and its call in the editor Save handler in runner/apps/authoring/src, updates runner/docs/observability-contract.md section 5, and replaces the tests that pinned the fallback. All other example analytics (example.open, example.engaged, example.forked, example.shared, example.downloaded) and the example.saved metric definition are untouched. The API's exampleSaved response key stays: production code no longer reads it, but the API tests assert it and it remains a cheap signal of whether the point was written, so removing it is left out of this PR.

Timing: the fallback only protects a new browser bundle paired with an API that lacks the exampleSaved marker. The marker shipped with #371 (first o11y deploy, 2026-09-29, master run 36553451764), so the risky pair needs an API rollback to a pre-#371 version, which would also remove the observability stack (the o11y and api workers are bound to each other) and is not a realistic rollback. The maintainer chose to merge a few days after opening as a buffer, not because of a hard requirement. The branch was rebased onto current master (conflicts in the editor Save handler after the save-guard change and in contract section 5 resolved by keeping master's text and removing only the fallback).

Types of changes

  • New example
  • Update to an existing example
  • README / documentation change
  • Demo runner (runner/) change
  • CI / tooling change

How was this verified?

Deterministic tests only, no external services and no production access. pnpm --filter @handsontable/demo-runtime build then node --experimental-strip-types --test pipeline/*.test.mjs: 2593 tests, 2593 pass, 0 fail (two browserCountsSave unit tests removed). pnpm -r run typecheck is clean for authoring, editor-shell and both workers. E2E_TELEMETRY=1 playwright test e2e/example-analytics.spec.ts: 7 of 7 pass, with stubbed Save responses and the spec's own local build. The former "Save answered without the marker emits one browser example.saved" spec now asserts zero example.saved events after a Save whose response has no marker, and it runs the real editor Save path. Revert-check: restoring the base App.tsx and exampleAnalytics.ts via git checkout 263de70c8 -- <paths> makes that spec fail (expected length 0, received 1 browser example.saved); the files were then put back.

Checklist

  • New/renamed example: added to runner/config/frameworks.json (see CONTRIBUTING.md); otherwise it won't appear on demos.handsontable.com (n/a, no example added or renamed)
  • New example: added a row to the tables in README.md (n/a)
  • Ran pnpm build (and pnpm dev) in the affected example/server-example locally (n/a, runner change; runner build, tests and typecheck run as listed above)

Related issue(s):

  1. Follow-up to the API-side example.saved emitter (ADR-0042 section 2, contract section 5)

@demtario demtario self-assigned this Sep 29, 2026
@demtario
demtario marked this pull request as ready for review September 30, 2026 13:18
The API worker is the only emitter of example.saved; the editor no longer counts a Save when the response lacks the exampleSaved marker.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@demtario
demtario force-pushed the chore/remove-browser-example-saved-fallback branch from 414e80b to fcbb3f8 Compare September 30, 2026 13:22
@demtario
demtario merged commit 241c4bd into master Sep 30, 2026
8 checks passed
@demtario
demtario deleted the chore/remove-browser-example-saved-fallback branch September 30, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant