Skip to content

RI-8224 Telemetry events for array key flows#6159

Open
VaskoAtanasovRedis wants to merge 1 commit into
mainfrom
fe/RI-8224/array-telemetry-events
Open

RI-8224 Telemetry events for array key flows#6159
VaskoAtanasovRedis wants to merge 1 commit into
mainfrom
fe/RI-8224/array-telemetry-events

Conversation

@VaskoAtanasovRedis

@VaskoAtanasovRedis VaskoAtanasovRedis commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What

Adds the missing analytics events for the array key type, following the Vector Set pattern:

  • ARRAY_VIEW_QUERY_RUN, ARRAY_SEARCH_QUERY_RUN, ARRAY_AGGREGATE_QUERY_RUN - fired only on an explicit Run in each tab (auto-fetch on key switch, reset, and reveal stay silent); eventData carries the query shape (flags, counts, criteria discriminators), never user values.
  • ARRAY_ELEMENT_ADDED (mode: append | at_index) and ARRAY_ELEMENT_EDITED - fired in the slice thunks on confirmed writes, mirroring the existing delete events.
  • ARRAY_CREATED (source: scratch | sample_dataset, mode: contiguous | sparse for scratch) and ARRAY_SAMPLE_DATASET_LOADED (collectionName) - fired from the AddKey form; nothing fires when the sample key already exists or the import fails.

Also backfills missing test assertions for the existing ARRAY_ELEMENT_DELETED / ARRAY_RANGE_DELETED events.

Testing

  • Unit tests cover every event: fired exactly once with the exact eventData on the happy path, and silent on failure, stale-selection, auto-fetch, reset, and reveal paths (160 tests across the 5 touched suites).
  • yarn lint:ui, yarn type-check green.

Closes #RI-8224


Note

Low Risk
Analytics-only instrumentation with no change to Redis commands or auth; behavior is additive and heavily test-covered.

Overview
Adds array key telemetry aligned with the Vector Set pattern: new TelemetryEvent values and sendEventTelemetry calls across create, query, and CRUD flows.

Create (AddKeyArray) emits ARRAY_CREATED (scratch vs sample_dataset, contiguous/sparse for manual) and ARRAY_SAMPLE_DATASET_LOADED (collectionName) on successful sample import; sample duplicate-key and failed import paths stay silent. Manual create fires ARRAY_CREATED from the addArrayKey success callback.

Key details hooks fire query events only on explicit user Run / Search: ARRAY_VIEW_QUERY_RUN (showEmpty), ARRAY_SEARCH_QUERY_RUN (counts, criteria types, flags—no predicate values), ARRAY_AGGREGATE_QUERY_RUN (operation). Auto-fetch on key switch, reset, reveal, and not-ready clicks do not emit.

Redux array thunks emit ARRAY_ELEMENT_ADDED (append | at_index) and ARRAY_ELEMENT_EDITED on successful API responses, alongside existing delete events.

Unit tests assert happy-path payloads and silence on failure, stale selection, and non-user-initiated paths; slice CRUD tests use module reload to mock telemetry.

Reviewed by Cursor Bugbot for commit 747fe0b. Bugbot is set up for automated code reviews on this repo. Configure here.

Fires one analytics event per array affordance: View/Search/Aggregate
query runs, element add/edit, key creation by mode (contiguous/sparse),
and sample dataset load. Run events fire only on explicit user runs;
auto-fetches on key switch, reset, and reveal stay silent. Backfills
test assertions for the existing element/range delete events.

References: #RI-8224
@VaskoAtanasovRedis VaskoAtanasovRedis requested a review from a team as a code owner July 6, 2026 13:45
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.69% 26833/32063
🟡 Branches 69.42% 11416/16446
🟡 Functions 78.99% 7171/9078
🟢 Lines 84.15% 26140/31063

Test suite run success

7620 tests passing in 847 suites.

Report generated by 🧪jest coverage report action from 747fe0b

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