Skip to content

Commit f50765a

Browse files
committed
chore: remove the sidebar_loaded event
1 parent ce45b95 commit f50765a

9 files changed

+0
-59
lines changed

contributingGuides/PERFORMANCE_METRICS.md

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Project is using Firebase for tracking these metrics. However, not all of them a
1414
| `js_loaded` || The time it takes for the JavaScript bundle to load. <br><br>**Platforms:** Android, iOS | **Android:** Starts in the `onCreate` method.<br><br>**iOS:** Starts in the AppDelegate's `didFinishLaunchingWithOptions` method. | Stops at the first render of the app via native module on the JS side. |
1515
| `_app_in_foreground` || The time when the app is running in the foreground and available to the user.<br><br>**Platforms:** Android, iOS | **Android:** Starts when the first activity to reach the foreground has its `onResume()` method called. <br><br>**iOS:** Starts when the application receives the `UIApplicationDidBecomeActiveNotification` notification. | **Android:** Stops when the last activity to leave the foreground has its `onStop()` method called. <br><br>**iOS:** Stops when it receives the `UIApplicationWillResignActiveNotification` notification. |
1616
| `_app_in_background` || Time when the app is running in the background.<br><br>**Platforms:** Android, iOS | **Android:** Starts when the last activity to leave the foreground has its `onStop()` method called. <br><br>**iOS:** Starts when the application receives the `UIApplicationWillResignActiveNotification` notification. | **Android:** Stops when the first activity to reach the foreground has its `onResume()` method called. <br><br>**iOS:** Stops when it receives the `UIApplicationDidBecomeActiveNotification` notification. |
17-
| `sidebar_loaded` || Time taken for the Sidebar to load.<br><br>**Platforms:** All | Starts when the Sidebar is mounted. | Stops when the Splash Screen is hidden. |
1817
| `calc_most_recent_last_modified_action` || Time taken to find the most recently modified report action or report.<br><br>**Platforms:** All | Starts when the app reconnects to the network | Ends when the app reconnects to the network and the most recent report action or report is found. |
1918
| `search_render` || Time taken to render the Chat Finder page.<br><br>**Platforms:** All | Starts when the Chat Finder icon in LHN is pressed. | Stops when the list of available options is rendered for the first time. |
2019
| `load_search_options` || Time taken to generate the list of options used in Chat Finder.<br><br>**Platforms:** All | Starts when the `getSearchOptions` function is called. | Stops when the list of available options is generated. |

src/CONST.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,6 @@ const CONST = {
11331133
SWITCH_REPORT: 'switch_report',
11341134
OPEN_REPORT_FROM_PREVIEW: 'open_report_from_preview',
11351135
OPEN_REPORT_THREAD: 'open_report_thread',
1136-
SIDEBAR_LOADED: 'sidebar_loaded',
11371136
LOAD_SEARCH_OPTIONS: 'load_search_options',
11381137
MESSAGE_SENT: 'message_sent',
11391138
COLD: 'cold',

src/Expensify.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ function Expensify() {
138138

139139
const onSplashHide = useCallback(() => {
140140
setSplashScreenState(CONST.BOOT_SPLASH_STATE.HIDDEN);
141-
Performance.markEnd(CONST.TIMING.SIDEBAR_LOADED);
142141
}, [setSplashScreenState]);
143142

144143
useLayoutEffect(() => {

src/libs/E2E/tests/chatOpeningTest.e2e.ts

-10
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ import waitForAppLoaded from '@libs/E2E/actions/waitForAppLoaded';
55
import E2EClient from '@libs/E2E/client';
66
import getConfigValueOrThrow from '@libs/E2E/utils/getConfigValueOrThrow';
77
import getPromiseWithResolve from '@libs/E2E/utils/getPromiseWithResolve';
8-
import Navigation from '@libs/Navigation/Navigation';
98
import Performance from '@libs/Performance';
109
import CONST from '@src/CONST';
11-
import ROUTES from '@src/ROUTES';
1210

1311
const test = (config: NativeConfig) => {
1412
// check for login (if already logged in the action will simply resolve)
1513
console.debug('[E2E] Logging in for chat opening');
1614

17-
const reportID = getConfigValueOrThrow('reportID', config);
1815
const name = getConfigValueOrThrow('name', config);
1916

2017
E2ELogin().then((neededLogin) => {
@@ -37,13 +34,6 @@ const test = (config: NativeConfig) => {
3734
});
3835

3936
Performance.subscribeToMeasurements((entry) => {
40-
if (entry.name === CONST.TIMING.SIDEBAR_LOADED) {
41-
console.debug(`[E2E] Sidebar loaded, navigating to report…`);
42-
Performance.markStart(CONST.TIMING.OPEN_REPORT);
43-
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID));
44-
return;
45-
}
46-
4737
console.debug(`[E2E] Entry: ${JSON.stringify(entry)}`);
4838

4939
if (entry.name === CONST.TIMING.OPEN_REPORT) {

src/libs/E2E/tests/linkingTest.e2e.ts

-9
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import waitForAppLoaded from '@libs/E2E/actions/waitForAppLoaded';
66
import E2EClient from '@libs/E2E/client';
77
import getConfigValueOrThrow from '@libs/E2E/utils/getConfigValueOrThrow';
88
import getPromiseWithResolve from '@libs/E2E/utils/getPromiseWithResolve';
9-
import Navigation from '@libs/Navigation/Navigation';
109
import Performance from '@libs/Performance';
1110
import CONST from '@src/CONST';
12-
import ROUTES from '@src/ROUTES';
1311

1412
type ViewableItem = {
1513
reportActionID?: string;
@@ -20,7 +18,6 @@ type ViewableItemResponse = Array<{item?: ViewableItem}>;
2018
const test = (config: NativeConfig) => {
2119
console.debug('[E2E] Logging in for comment linking');
2220

23-
const reportID = getConfigValueOrThrow('reportID', config);
2421
const linkedReportActionID = getConfigValueOrThrow('linkedReportActionID', config);
2522
const name = getConfigValueOrThrow('name', config);
2623

@@ -53,12 +50,6 @@ const test = (config: NativeConfig) => {
5350
});
5451

5552
Performance.subscribeToMeasurements((entry) => {
56-
if (entry.name === CONST.TIMING.SIDEBAR_LOADED) {
57-
console.debug('[E2E] Sidebar loaded, navigating to a report…');
58-
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID));
59-
return;
60-
}
61-
6253
if (entry.name === CONST.TIMING.SWITCH_REPORT) {
6354
console.debug('[E2E] Linking: 1');
6455

src/libs/E2E/tests/openSearchRouterTest.e2e.ts

-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Config from 'react-native-config';
22
import type {NativeConfig} from 'react-native-config';
3-
import * as E2EGenericPressableWrapper from '@components/Pressable/GenericPressable/index.e2e';
43
import E2ELogin from '@libs/E2E/actions/e2eLogin';
54
import waitForAppLoaded from '@libs/E2E/actions/waitForAppLoaded';
65
import E2EClient from '@libs/E2E/client';
@@ -36,29 +35,6 @@ const test = (config: NativeConfig) => {
3635

3736
Performance.subscribeToMeasurements((entry) => {
3837
console.debug(`[E2E] Entry: ${JSON.stringify(entry)}`);
39-
if (entry.name === CONST.TIMING.SIDEBAR_LOADED) {
40-
const props = E2EGenericPressableWrapper.getPressableProps('searchButton');
41-
if (!props) {
42-
console.debug('[E2E] Search button not found, failing test!');
43-
E2EClient.submitTestResults({
44-
branch: Config.E2E_BRANCH,
45-
error: 'Search button not found',
46-
name: `${name} Open Search Router TTI`,
47-
}).then(() => E2EClient.submitTestDone());
48-
return;
49-
}
50-
if (!props.onPress) {
51-
console.debug('[E2E] Search button found but onPress prop was not present, failing test!');
52-
E2EClient.submitTestResults({
53-
branch: Config.E2E_BRANCH,
54-
error: 'Search button found but onPress prop was not present',
55-
name: `${name} Open Search Router TTI`,
56-
}).then(() => E2EClient.submitTestDone());
57-
return;
58-
}
59-
// Open the search router
60-
props.onPress();
61-
}
6238

6339
if (entry.name === CONST.TIMING.SEARCH_ROUTER_RENDER) {
6440
E2EClient.submitTestResults({

src/libs/E2E/tests/reportTypingTest.e2e.ts

-4
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ const test = (config: NativeConfig) => {
5353
return;
5454
}
5555

56-
if (entry.name !== CONST.TIMING.SIDEBAR_LOADED) {
57-
return;
58-
}
59-
6056
console.debug(`[E2E] Sidebar loaded, navigating to a report…`);
6157
// Crowded Policy (Do Not Delete) Report, has a input bar available:
6258
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID));

src/libs/Performance.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ if (Metrics.canCapturePerformanceMetrics()) {
160160
}
161161

162162
// Capture any custom measures or metrics below
163-
if (mark.name === `${CONST.TIMING.SIDEBAR_LOADED}_end`) {
164-
Performance.measureFailSafe('contentAppeared_To_screenTTI', 'contentAppeared', mark.name);
165-
Performance.measureTTI(mark.name);
166-
}
167163
});
168164
}).observe({type: 'mark', buffered: true});
169165
};

src/pages/home/sidebar/SidebarScreen/BaseSidebarScreen.tsx

-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ function BaseSidebarScreen() {
3131
const {shouldUseNarrowLayout} = useResponsiveLayout();
3232
const [activeWorkspace] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activeWorkspaceID ?? -1}`);
3333

34-
useEffect(() => {
35-
Performance.markStart(CONST.TIMING.SIDEBAR_LOADED);
36-
Timing.start(CONST.TIMING.SIDEBAR_LOADED);
37-
}, []);
38-
3934
useEffect(() => {
4035
if (!!activeWorkspace || activeWorkspaceID === undefined) {
4136
return;

0 commit comments

Comments
 (0)