pulse_ops 1.4.0 copy "pulse_ops: ^1.4.0" to clipboard
pulse_ops: ^1.4.0 copied to clipboard

Flutter-native developer toolkit for in-app network inspection, cURL export, log sharing, shake-to-open, and crash diagnostics with breadcrumbs.

Changelog #

All notable changes to PulseOps will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

1.4.0 โ€” 2026-06-25 #

๐Ÿงช Test Observability #

Testing Tools

  • Widget test logging โ€” PulseTestObserver.log() captures freeform messages into the active test session with severity levels (debug / info / warning / error).
  • Integration test tracking โ€” PulseTestObserver.beginTest() / PulseTestObserver.endTest() create bounded TestSession records with name, group, status, timing, and a full event timeline.
  • API logs during tests โ€” PulseTestObserver.captureNetworkRequest() attaches any NetworkRecord from PulseDioInterceptor to the active session, so you can see exactly which API calls were made (and whether they succeeded) per test.
  • Test timelines โ€” each session stores an ordered List<TestEvent> with typed events: log, networkRequest, assertion, widgetPump, performance, failure โ€” visible as a visual connector timeline in the inspector.
  • Failure diagnostics โ€” PulseTestObserver.endTest(passed: false, failureMessage: ..., stackTrace: ...) records the failure with up to 12 lines of stack trace displayed in the inspector.
  • Assertion tracking โ€” PulseTestObserver.assertion(description) records named assertion results, coloured green (pass) or red (fail) in the timeline.
  • Widget pump events โ€” PulseTestObserver.pump(frameCount:, duration:) logs pump calls so you can correlate widget rebuilds with API activity.
  • Performance snapshots โ€” PulseTestObserver.capturePerformance(fps:, droppedFrames:) stores FPS/jank data captured during a test.

Reporting

  • Exportable test reports โ€” the Test screen shares reports in JSON (structured, machine-readable) or plain text (human-readable per-session block) via the platform share sheet, falling back to clipboard.
  • Pass-rate summary bar โ€” total / passed / failed counts and percentage pass rate shown at the top of the Test screen.
  • Debug logs attachment โ€” exported JSON includes per-session events and network request summaries, making the report self-contained for CI artefact upload.

New Public API

  • TestStore โ€” in-memory ring-buffer (default 100 sessions, configurable via PulseOpsConfig.maxTestSessions) with beginSession / endSession / logEvent / recordNetworkRequest / recordPerformance and a reactive stream.
  • PulseTestObserver โ€” static helper; attach a store once per test run with PulseTestObserver.attach(PulseOps.instance.testStore), then use beginTest / endTest / log / assertion / pump / captureNetworkRequest / capturePerformance.
  • TestReportExporter โ€” serialises sessions to JSON or plain text.
  • TestSession / TestEvent / TestSessionStatus / TestEventType โ€” immutable value types exported from the public API.
  • PulseOpsConfig.enableTestObservability โ€” opt-in flag (default false).
  • PulseOpsConfig.maxTestSessions โ€” ring-buffer capacity (default 100).

๐Ÿ”ฌ Inspector: Tests Screen #

  • New ๐Ÿงช toolbar button in the inspector opens the Test Observability screen showing a session list with status dots, group labels, failure previews, network/event badges, and a pass-rate summary bar.
  • Session detail screen shows a connector-style event timeline with typed badges (LOG / NET / ASSERT / PUMP / PERF / FAIL), per-event timing, and a dedicated API log section with method chip, endpoint, status, and duration.

๐Ÿ›  Enhancements & Bug Fixes #

  • InMemoryNetworkStore โ€” replaced the O(n) linear scan in findById and update with an id โ†’ record hash map index. Both are now O(1), eliminating a latency spike on large request histories (previously O(nยฒ) on update).
  • FileBackedNetworkStore._persist() โ€” added a try/catch around writeAsStringSync; disk-full and permission errors are now silently suppressed instead of crashing the app mid-request.

1.3.0 โ€” 2026-06-04 #

๐Ÿง  Memory Monitoring #

  • RSS memory tracking โ€” polls ProcessInfo.currentRss every 2 s (configurable) and stores up to 120 snapshots in a ring buffer.
  • Memory spike warnings โ€” samples >20% above the rolling average are flagged and highlighted in the RSS sparkline chart.
  • Leak detection โ€” subscribes to FlutterMemoryAllocations to track ChangeNotifier, AnimationController, TextEditingController, and other disposable Flutter objects. Objects not disposed within 30 s are listed as potential leaks with their age.
  • Widget lifecycle log โ€” live created/disposed/active counts and a type-breakdown of the top active objects.
  • Rebuild tracker โ€” call store.recordRebuild(widgetType) (or use the provided PulseRebuildTracker mixin) to track how often each widget rebuilds. Counts appear colour-coded in the Memory screen (red >50, yellow >20).
  • Memory screen accessible from the inspector toolbar (๐Ÿง  button), showing the RSS chart, spike warnings, leak list, lifecycle summary, and rebuild counts.

๐Ÿ’พ Persistent Network Store #

  • FileBackedNetworkStore โ€” a drop-in NetworkStore replacement that persists captured records to a JSON file in the app's documents directory. Records survive app restarts. Pass it to PulseOps.initialize(networkStore:).

๐Ÿ“ก Unified Event Exporter #

  • PulseEventExporter โ€” new interface with two callbacks: onFailedRequest(NetworkRecord) and onCrash(error, stack, ...). Implement it and pass it to PulseOps.initialize(eventExporter:) to forward every failed API call and every crash to your own backend in one place.

1.2.0 โ€” 2026-05-22 #

โšก Performance Monitoring #

  • Real-time FPS monitor โ€” subscribes to WidgetsBinding frame timings and streams FPS data into a rolling 300-frame ring buffer.
  • Frame drop & jank detection โ€” frames exceeding 16 ms are flagged as dropped; frames exceeding 33 ms are marked severe jank.
  • Startup time tracking โ€” measures wall-clock time from PulseOps.initialize to the first rendered frame.
  • API latency chart โ€” CustomPainter bar chart showing the last 40 request durations, coloured green / yellow / red against the slow-request threshold.
  • FPS sparkline chart โ€” gradient-filled line chart with 60 fps / 30 fps reference grid lines, coloured by current FPS health.
  • Performance screen accessible from the inspector toolbar (โšก button), showing startup banner, FPS stats, frame drop list, and latency charts.

๐Ÿ” Inspector Improvements #

  • Slow filter chip โ€” one-tap filter to show only requests that exceeded the configured slowRequestThresholdMs.
  • Status-family filter chips โ€” filter by 2xx, 3xx, 4xx, or 5xx response families.
  • Wider search โ€” search now matches against host name and error message in addition to URL, method, and status code.

1.1.1 โ€” 2026-05-21 #

๐Ÿ› Bug Fixes #

  • Fixed No Directionality widget found crash on Android and iOS when the PulseOverlay Stack was mounted above the host app's MaterialApp. The overlay now wraps the Stack in an explicit Directionality(ltr).
  • Fixed RenderFlex overflowed yellow-stripe in RequestTile when the host name is long (e.g. jsonplaceholder.typicode.com). The host Text is now wrapped in Flexible so it ellipsises instead of overflowing.

๐Ÿ“š Documentation #

  • Added a Sentry adapter code snippet to the README โ€” drop-in equivalent of the existing Firebase Crashlytics adapter. Covers non-fatal, fatal, breadcrumbs, network history, and custom tags via Sentry.configureScope.
  • Updated CI workflow (publish.yml) to use flutter pub get, flutter analyze, and flutter test instead of their bare dart equivalents, fixing the "Flutter users should use flutter pub" error in GitHub Actions.

1.1.0 โ€” 2026-05-16 #

๐Ÿ›  Debug Overlay #

  • Shake-to-open: shaking the device launches the inspector. Tunable via PulseOpsConfig.enableShakeToOpen and shakeThreshold. Powered by sensors_plus and silently no-ops when an accelerometer is unavailable.
  • Expandable bottom sheet: the inspector now slides up as a draggable bottom sheet with 40 / 70 / 95 % snap points instead of a full-screen route. Switch back via PulseOpsConfig(inspectorPresentation: InspectorPresentation.fullScreen).

โœจ Developer Experience #

  • Log export: new export menu in the inspector (JSON / plain text / cURL) that opens the platform share sheet via share_plus and falls back to clipboard. Programmatic exports available via NetworkLogExporter.

Migration #

  • PulseOps.openInspector now respects inspectorPresentation. Existing callers continue to work unchanged.

1.0.0 โ€” 2026-05-16 #

Initial public release.

๐ŸŒ Network Inspector #

  • Dio interceptor (PulseDioInterceptor) capturing request, response, headers, query params, timing, sizes, and errors.
  • In-memory ring-buffer store (InMemoryNetworkStore) with configurable capacity and reactive stream API.
  • Beautiful dark Material 3 inspector UI:
    • Newest-first timeline with method, status, host, duration, timestamp.
    • Live search and filter chips (GET / POST / PUT / PATCH / DELETE, plus "failed only").
    • Per-request detail screen with Overview, Headers, Request, Response, and cURL tabs.
    • Syntax-highlighted JSON viewer with copy-to-clipboard.
  • One-tap cURL export via CurlBuilder with proper shell escaping.
  • One-tap retry using a host-provided Dio instance.
  • Multipart (FormData) request description, including filenames + sizes.
  • Header / body sanitization for sensitive keys.

๐Ÿ’ฅ Crash Diagnostics #

  • Backend-agnostic PulseCrashReporter interface with shipped NoopCrashReporter and a documented Firebase Crashlytics adapter.
  • BreadcrumbTrail ring buffer with debug / info / warning / error levels.
  • Automatic non-fatal reporting for failed Dio requests, with recent request summary attached as context.
  • Manual breadcrumb + error APIs: PulseOps.instance.log(...), PulseOps.instance.recordError(...).
  • Optional global FlutterError.onError and PlatformDispatcher.onError installation.

Developer Experience #

  • Single-call PulseOps.initialize(...) with shorthand crashlytics, enableInRelease, and sanitizeKeys named args.
  • PulseOps.instance.wrap(child:) to mount the draggable floating overlay launcher around any widget tree.
  • PulseOps.instance.openInspector(context) to push the inspector from a debug menu without the overlay.
  • Production-safe: inspector and overlay are disabled in release builds unless enableInRelease is explicitly set.
  • Comprehensive test suite covering sanitizer, cURL builder, store, breadcrumb trail, interceptor, and facade.
1
likes
160
points
23
downloads

Documentation

API reference

Publisher

verified publisherhimanshulahoti.is-a.dev

Weekly Downloads

Flutter-native developer toolkit for in-app network inspection, cURL export, log sharing, shake-to-open, and crash diagnostics with breadcrumbs.

Repository (GitHub)
View/report issues

Topics

#networking #debugging #inspector #crashlytics #developer-tools

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

dio, flutter, flutter_riverpod, intl, meta, path_provider, sensors_plus, share_plus

More

Packages that depend on pulse_ops