Skip to content

Instantly share code, notes, and snippets.

View SudoPlz's full-sized avatar
💥
shipit

Ioannis Kokkinidis SudoPlz

💥
shipit
View GitHub Profile

Network events

Category Subcategory Event Description & Trigger Implementation File Example Payload Confirmed
✅ Network events network_usage app_network_usage Snapshot of how many bytes we sent/received when the NetStats poller runs. modules/network/NetStats.android.tsx
View
{
  "event": "app_network_usage",
  "total_receive_bytes": 312345678,
  "total_send_bytes": 182345123
}

Gestures

Category Subcategory Event Description & Trigger Implementation File Example Payload Confirmed

Full Table With AppComponentFactory Mapping

Category Entry Point What Happens AppComponentFactory Method
Activities Normal launcher activity User taps app icon instantiateActivity
Deep link URL launches your Activity instantiateActivity
App shortcut Long-press → quick action → Activity instantiateActivity
Share sheet target Share to Discord → ShareActivity instantiateActivity
Notification tap Tapping a push notification instantiateActivity
Task restore OS recreates Activity after kill instantiateActivity
API 25 Pixel 1
Scenario 1: COLD START
TTI: 1232ms
Type: COLD
Main Application to Activity time: 50ms
Scenario 2: App backgrounded, Activity killed, application on
@SudoPlz
SudoPlz / scenarios.md
Last active November 5, 2025 19:55
tti calculation scenarios

TTI Measurement Scenarios Analysis

Implementation Note

appOpenedTime always uses mainActivityStartTime: The difference between appStartedTimestamp (process creation) and mainActivityStartTime (MainActivity creation) is negligible (20-40ms). Using mainActivityStartTime consistently simplifies the code and fixes edge cases where the conditional logic couldn't distinguish between different launch scenarios (9c, 9f).


Scenarios Analysis

Reduced Motion + React-Freeze Bug Analysis

Problem Summary

Issue: Gray screen appears on Android when users enable "Reduce Motion" accessibility setting and quickly swipe between channels.

Root Cause: Animation updates (translateX) arrive while components are frozen/unregistered, causing updates to be lost and components to render with stale values.

Context: I've been working on this issue and there are currently three different solutions in play. I want to present the situation to the team and get alignment on the best approach.

React Freeze Performance Analysis Report

Executive Summary

This comprehensive performance analysis compares react-freeze against custom freeze implementations and a no-optimization baseline. The results demonstrate that react-freeze provides superior performance across all metrics, with 8x faster frozen rendering and 3.6x fewer total renders compared to no optimization.

Test Methodology

package com.imagepicker;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import androidx.activity.result.ActivityResultLauncher;
@SudoPlz
SudoPlz / Readme.md
Last active November 27, 2025 11:30
React Native Reanimated Microtask Bug

Reanimated Animations Stalling?

How Szymon and I traced it to an Infinite Loop & Fixed It

tl;dr – A tiny helper (infiniteThenable) inside react-freeze made React’s Fabric scheduler loop forever, so the JS → UI microtask bridge never got a chance to flush. We patched the scheduler to flush manually and replaced the culprit with React 19’s Offscreen – animations are smooth again.


1. The Symptoms

  • Animations powered by Reanimated randomly froze.
/**
* @param string $parentAccountName - the account id you want to fetch locations for (i.e. accounts/105837778216009211413)
* @param array|string|null $readMask - the fields you want to include in the response, available fields here https://developers.google.com/my-business/reference/businessinformation/rest/v1/locations#resource:-location
* @return array
* @throws Exception
*/
public function getAllLocationsForAccount(string $parentAccountName, array|string|null $readMask = "name,title,storecode,labels"): array
{
$businessInformationService = new MyBusinessBusinessInformation($this->client);
try {
@SudoPlz
SudoPlz / react-native.patch
Created October 23, 2023 17:59
React-Native RCTLinking patch to never miss deep links
diff --git a/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm b/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm
index cfa9078..6a3daf5 100644
--- a/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm
+++ b/node_modules/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm
@@ -18,15 +18,19 @@
static void postNotificationWithURL(NSURL *URL, id sender)
{
+
NSDictionary<NSString *, id> *payload = @{@"url" : URL.absoluteString};