-
-
Notifications
You must be signed in to change notification settings - Fork 360
Multiple TimeToInitialDisplay / TimeToFullDisplay #5934
Copy link
Copy link
Open
Labels
Description
The current TimeToFullDisplay component is strictly single-instance per screen:
<TimeToFullDisplay record={boolean} />renders a nativeRNSentryOnDrawReporterwithfullDisplay={true}- The native side records a single timestamp stored under
ttfd-${rootSpanId} timeToDisplayIntegration.processEvent()callsNATIVE.popTimeToDisplayFor('ttfd-${rootSpanId}')- That single timestamp becomes the TTFD measurement
If you place multiple <TimeToFullDisplay /> components in the tree, only the last native draw report wins.
The idea
The proposed ready={boolean} API is essentially: register N checkpoints, TTFD resolves when all of them are ready. This would require:
- A registry — track all mounted
TimeToFullDisplayinstances for the current screen/span - A coordination layer — only fire the TTFD signal when every instance reports
ready={true} - Lifecycle handling — components mount/unmount dynamically, late-mounting components need to be counted.
Out component architecture is already close. Here is what we would need:
- A React context (or module-level registry keyed by active span) that collects all
TimeToFullDisplayinstances - Each instance registers on mount, unregisters on unmount
- The ready prop triggers a check: "are all registered instances ready?" → if yes, trigger the native draw report
The timeout logic in startTimeToFullDisplaySpan (30s deadline) already handles the "what if something never resolves" case.
Possible complcations
The tricky parts would be:
- Late-mounting components — a component that mounts after others are already ready should reset the "all ready" state
- Conditional rendering — components that mount only after data loads (common pattern) need to register before they're ready
- Screen transitions — cleanup when navigating away, especially with React Navigation's keep-alive behavior
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Fields
Give feedbackNo fields configured for issues without a type.