Skip to content

Conversation

@abelonogov-ld
Copy link
Contributor

@abelonogov-ld abelonogov-ld commented Oct 24, 2025

  • Stop/Start SR on session expiring backround
  • Allow multiple subscribers for App Life Cycle events

Note

Introduce AppLifecycleManager and stream-based session changes; refactor Session Replay to start/stop with app lifecycle and reinitialize on session resets, powered by a new Broadcaster.

  • Core/Common:
    • Add Broadcaster<Value> actor to fan-out AsyncStream events to multiple subscribers.
    • Update Task.sleep(seconds:) to use NSEC_PER_SEC.
    • GraphQLClient: pass through NetworkError before decoding fallback.
  • Observability:
    • Replace ObservabilityContext with a class; add appLifecycleManager and make core refs immutable.
    • Introduce AppLifecycleManager that exposes app lifecycle as AsyncStream<AppLifeCycleEvent>.
    • ObservabilityClientFactory: create and inject AppLifecycleManager into SessionManager and ObservabilityContext.
    • Overhaul SessionManager:
      • Subscribe to AppLifecycleManager (remove NotificationCenter observers).
      • Provide sessionChanges() AsyncStream<SessionInfo> and compute timeout using DispatchTime.
      • Reset session on background timeout; log resets.
    • Remove SessionState enum; expand SessionInfo defaults and attributes.
    • Add test SessionManagerMemoryTests to assert deallocation (no leak).
  • Session Replay:
    • Add SessionReplayEventGenerator to build RRWeb-compatible events (image, viewport, interactions).
    • Refactor SessionReplayExporter:
      • Lazy initialize/identify session; listen to sessionChanges() to reinitialize.
      • Use SessionReplayEventGenerator; add logging; clean up on deinit.
    • SnapshotTaker: observe lifecycle to start/stop periodic screenshots; require AppLifecycleManaging.
    • SessionReplayService: pass appLifecycleManager to SnapshotTaker; include log in SessionReplayContext.
  • TestApp:
    • Update sample config/mobile key; minor API rename used by snapshot button.
  • Misc:
    • Remove unused payloadEncoded.txt; minor cleanups.

Written by Cursor Bugbot for commit 388fb96. This will update automatically on new commits. Configure here.

@abelonogov-ld abelonogov-ld requested a review from a team as a code owner October 24, 2025 15:05
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@abelonogov-ld abelonogov-ld enabled auto-merge (squash) October 24, 2025 18:42
@abelonogov-ld abelonogov-ld merged commit 5a2fc4d into main Oct 24, 2025
4 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/sr-app-lifecycle branch October 24, 2025 18:43
Vadman97 pushed a commit that referenced this pull request Oct 24, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.5.0](0.4.0...v0.5.0)
(2025-10-24)


### Features

* log memory warnings instrumentation
([#40](#40))
([4f9ccf0](4f9ccf0))
* maskWebView option and accesibilityIdentifier support
([#44](#44))
([7d029bd](7d029bd))
* Session Replay App Life Cycle
([#45](#45))
([5a2fc4d](5a2fc4d))
* **system-metrics:** add auto instrumentation for cpu and memory
([#36](#36))
([95ca6fc](95ca6fc))


### Bug Fixes

* Limit Package.swift to iOS and TV
([#34](#34))
([7d76b65](7d76b65))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Bumps to 0.5.0 and updates changelog with new instrumentation/features
and an iOS/TV packaging fix.
> 
> - **Changelog (0.5.0)**:
>   - **Features**:
>     - Log memory warnings instrumentation
>     - `maskWebView` option and `accessibilityIdentifier` support
>     - Session Replay app lifecycle
>     - Auto-instrumentation for CPU and memory (`system-metrics`)
>   - **Bug Fix**:
>     - Limit `Package.swift` to iOS and tvOS
> - **Release**:
>   - Update `.release-please-manifest.json` from `0.4.0` to `0.5.0`
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
71c4dc4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

3 participants