Skip to content

Conversation

@abelonogov-ld
Copy link
Contributor

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

  • Make BatchWorker aware that any http request can fail, by creating failingItems which gonna be tried until network appears
  • Network Backoff

Note

Make batching resilient with per-exporter queues and backoff, route payloads to specific exporters, refactor UI interaction pipeline with multi-yield, and wire Session Replay through the shared context.

  • Transport/Batching:
    • Refactor BatchWorker into an actor with per-exporter scheduling, cost/parallelism limits, and exponential backoff with jitter on failures.
    • Replace MultiEventExporter with direct exporter registry; EventExporting is now Sendable and exposes typeId.
    • TransportService calls batchWorker.start/stop asynchronously.
  • Event Queue & Payloads:
    • EventQueueItemPayload adds exporterClass; EventQueueItem stores exporterTypeId.
    • EventQueue now buckets by exporter, supports earliest(cost:limit:except:) and removeFirst(id:count:).
    • Add exporterClass to LogItem, TouchInteraction, and ScreenImageItem to route to correct exporters.
  • UI Interactions:
    • Introduce TouchInteractionYield and make UserInteractionManager public with multi-listener support (addYield).
    • TouchCaptureCoordinator now accepts an optional yield and fans out via UserInteractionManager.
  • Session Replay:
    • Wire interactions via ObservabilityContext.userInteractionManager.addYield to enqueue events.
    • Initialize and register SessionReplayExporter with BatchWorker; adjust event generation control flow.
  • Observability Client/Context:
    • Add userInteractionManager to ObservabilityContext and pass through factory; remove direct queuing from factory interaction handler.

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

It puts failed items in the failedItems and try them until network is restored
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@abelonogov-ld abelonogov-ld enabled auto-merge (squash) November 1, 2025 00:34
cursor[bot]

This comment was marked as outdated.

auto-merge was automatically disabled November 3, 2025 16:52

Pull request was closed

@abelonogov-ld abelonogov-ld reopened this Nov 3, 2025
cursor[bot]

This comment was marked as outdated.

currentSize += item.cost
}

func earliest(cost: Int, limit: Int, except: Set<ObjectIdentifier>) -> (id: ObjectIdentifier, items: [EventQueueItem], cost: Int)? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to use an object instead a tuple

return (id: earlistEvent.id, items: items, cost: cost)
}

private func first(cost: Int, limit: Int, items: [EventQueueItem]) -> (items: [EventQueueItem], cost: Int)? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same suggestion, so you can reuse the object here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is private method

@abelonogov-ld abelonogov-ld merged commit 4ff18c5 into main Nov 4, 2025
5 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/offline-stability branch November 4, 2025 00:26
abelonogov-ld pushed a commit that referenced this pull request Nov 4, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.9.0](0.8.1...0.9.0)
(2025-11-04)


### Features

* cold, warm and hot launch times meter
([#66](#66))
([060338b](060338b))


### Bug Fixes

* Make Session Replay stable for offline or intermittent network
([#67](#67))
([4ff18c5](4ff18c5))

---
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]
> Release 0.9.0 adding launch time meters and improving Session Replay
stability, with version metadata and changelog updates.
> 
> - **Release 0.9.0**:
>   - **Feature**: Adds meters for cold, warm, and hot launch times.
> - **Bug fix**: Improves Session Replay stability for
offline/intermittent networks.
> - **Versioning/Docs**:
> - Bumps version to `0.9.0` in
`Sources/LaunchDarklyObservability/Version.swift` and
`.release-please-manifest.json`.
>   - Updates `CHANGELOG.md` with new entries.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1c9d651. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
abelonogov-ld added a commit that referenced this pull request Nov 4, 2025
* main:
  chore(main): release 0.9.0 (#68)
  fix: Make Session Replay stable for offline or intermittent network (#67)
  feat: cold, warm and hot launch times meter (#66)

# Conflicts:
#	Sources/Observability/Logs/LogItem.swift
#	Sources/Observability/Transport/BatchWorker.swift
#	Sources/Observability/Transport/EventQueue.swift
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