Open markushi opened 9 months ago
Let's be aware if the sync happens on a background thread, the data won't be available immediately on the NDK side. E.g. when next line in code performs JNI call.
Let's talk about this in the next sentry-native sync.
Let's check the top-level attributes in the data bag: If it's only primitives sync the breadcrumbs directly, otherwise offload to a background thread.
Let's also profile/compare the timings of syncing this with only primitives. If it's quick enough we could still do that on the main thread, otherwise offload to a bg thread
Problem Statement
As of now any context data (user, breadcrumb, tags, ...) is synced to
sentry-native
on the calling thread. The calling thread might be the main thread, which is not optimal.Solution Brainstorm
We should offload the scope sync to a background thread, ensuring we're not spending too much time on the main thread.