Skip to content

Add download/apply timing to Expo Updates listener integration #6337

Description

@antonis

expoUpdatesListenerIntegration listens to the expo-updates state machine and emits breadcrumbs for transitions (checking, downloading, update pending, errors, rollback, restart). However, it captures zero timestamps and zero durations — you can see that a download happened but not how long it took.

Implementation

Add a downloadSpan variable to the integration closure:

  1. Start a span (startInactiveSpan({ name: 'expo.updates.download', op: 'expo.updates.download' })) when isDownloading transitions false→true.
  2. End the span when isUpdatePending transitions false→true (download completed).
  3. End with error status if downloadError transitions true.
  4. Clear the span reference on subscription cleanup.

Edge cases (already handled by existing logic)

  • Download starts before SDK init: latestContext seeds previousContext on setup. If isDownloading is already true, the falsy-to-truthy check won't fire — no phantom span.
  • Download completes before SDK init: Same mechanism — isUpdatePending already true means no spurious span end.
  • Multiple sequential updates: Each new download cycle transitions isDownloading false→true again, starting a new span.
  • Download error (no pending): Span ends with error status on downloadError. Clear the reference so retries start a new span.
  • No active transaction: startInactiveSpan works as a standalone span.

Scope

JS only. ~20-30 lines of code + tests.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions