Skip to content

refactor(ads-client): telemetry callback interface#7443

Merged
Almaju merged 1 commit into
mozilla:mainfrom
Almaju:ads-client-telemetry-callback-interface
Jun 22, 2026
Merged

refactor(ads-client): telemetry callback interface#7443
Almaju merged 1 commit into
mozilla:mainfrom
Almaju:ads-client-telemetry-callback-interface

Conversation

@Almaju

@Almaju Almaju commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Revives #7407, rebased on the latest main.

MozAdsTelemetry is always implemented by the foreign side (JS/Kotlin/Swift) and is only ever passed from foreign code to Rust — never the other way around. callback_interface is the correct semantic for this pattern and enables the geckojs uniffi-bindgen-gecko-js pipeline to generate FireAndForget vtable handlers, avoiding a deadlock where Rust calls telemetry methods synchronously from within a callSync on the JS main thread.

The builder's telemetry() argument changes from Arc<dyn MozAdsTelemetry> to Box<dyn MozAdsTelemetry> accordingly.

Pull Request checklist

  • Quality: This PR builds and tests run cleanly (cargo test -p ads-client: 88 passed)
  • Tests: Covered by existing ads-client tests; this is a binding-semantics change with no behavioral difference on the Rust side.
  • Changelog: No changelog entry — internal binding refactor.

…_interface

MozAdsTelemetry is always implemented by the foreign side (JS/Kotlin/Swift)
and is only ever passed from foreign code to Rust — never the other way around.
callback_interface is the correct semantic for this pattern and enables the
geckojs uniffi-bindgen-gecko-js pipeline to generate FireAndForget vtable
handlers, avoiding a deadlock where Rust calls telemetry methods synchronously
from within a callSync on the JS main thread.
@Almaju Almaju requested a review from a team as a code owner June 22, 2026 19:24
@Almaju Almaju requested review from copyrighthero and removed request for a team June 22, 2026 19:24

@jonesetc jonesetc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@Almaju Almaju enabled auto-merge June 22, 2026 19:38
@Almaju Almaju added this pull request to the merge queue Jun 22, 2026
Merged via the queue into mozilla:main with commit 3cbf57e Jun 22, 2026
15 checks passed
@Almaju Almaju deleted the ads-client-telemetry-callback-interface branch June 22, 2026 20:09
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.

2 participants