JavaScript client-telemetry lib + eventual JS SDK (onerror handlers → campus.audit)

Open
#1,165 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
18/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
javascript, python
Domain
observability

Research direction

This is a design record, so the first step is the post-mortem trail: read classroom#123 and PR classroom#125 for the console-only failure, then campus.audit.middleware in flask-campus as the server-side pattern to mirror, alongside #941 (event_type client.error), #831 (rate-gate) and #805 (keyed redaction). Work through the four open questions — repo location, ingest shape, SDK scope, PII discipline — and record a decision. Done means those questions are answered on the issue and a concrete implementation issue can be opened; no code is expected here.

Written by the indexing model from the issue text.

Description

enhancement

Follow-up from the classroom#123 post-mortem (2026-11-18, triaged with the user). The #123 incident ("Create Assignment does nothing") produced exactly one signal anywhere in the stack: a single Chrome console line ("An invalid form control ... is not focusable"). No server request, no log, no trace — campus.audit structurally cannot see client-side failures, because it only sees requests that reach a server.

Direction agreed: client-side error telemetry, done in a disciplined way — a custom JavaScript lib that registers window.onerror / unhandledrejection handlers (plus a form.addEventListener('invalid', ...) capture, which would have named the exact blocked field in #123) and reports to a campus ingest endpoint so client failures land in campus.audit as first-class traces.

This issue is a design record, not an implementation order — implementation waits for the JavaScript SDK decision below.

Open questions to settle before building

  1. Where does the lib live? Options: (a) a new dedicated repo (tiny, dependency-free ES module, e.g. campus-telemetry-js); (b) inside campus-classroom's static assets to start, promoted later; (c) folded into the eventual JS SDK. Lean (a) or (b) now, (c) long-term.
  2. Ingest shape. A browser beacon endpoint (likely on each consumer app, same-origin to avoid CORS: e.g. POST /api/v1/client-events, forwarded into campus.audit as an audit-event trace (#941 event_type: client.error) with {message, source, lineno, stack (truncated), url, user_agent, session hint}). Rate-limit + payload caps are mandatory — an error storm must not become an ingest storm (cf. the #831 rate-gate work).
  3. JS SDK repo. A campus JavaScript SDK (client for campus APIs + telemetry + journey labeling) is a whole other repo — worth it once a second consumer app needs browser-side integration. Don't create it for this alone.
  4. PII/secrets discipline. Error messages can carry user data; apply the same keyed-redaction rules as the Python side (#805) client-side where feasible, server-side regardless.

Context

  • Python-side equivalent already exists: flask-campus campus.audit.middleware captures server spans opt-in per app.
  • Server-side enrichment of the same incident class: flask-campus middleware issue (static assets + warning capture) filed separately.
  • Post-mortem driver: classroom#123 + PR classroom#125.
Dominant language
Python
Stars
0
Forks
2
Avg merge
39m
Merged PRs (30d)
235

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nyjc-computing/campus

All issues in nyjc-computing/campus

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.