Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "expo-router/react-navigation";
import { Stack, useSegments } from "expo-router";
import { StatusBar } from "expo-status-bar";
import { useEffect } from "react";
import { StyleSheet, View } from "react-native";
import "react-native-reanimated";

Expand All @@ -19,8 +18,6 @@ import {
import { CydAccountProvider } from "@/contexts/CydAccountProvider";
import { useColorScheme } from "@/hooks/use-color-scheme";
import { useNotificationHandler } from "@/hooks/use-notification-handler";
import { trackEvent } from "@/services/analytics";
import { PlausibleEvents } from "@/types/analytics";

function RootLayoutContent() {
const colorScheme = useColorScheme();
Expand All @@ -34,11 +31,6 @@ function RootLayoutContent() {
// Hide CydAccountBar when on the account detail screen
const isAccountScreen = segments[0] === "account";

useEffect(() => {
// Track app opened event on initial load
trackEvent(PlausibleEvents.APP_OPENED);
}, []);

// Wait for onboarding check to complete before rendering
if (!hasChecked) {
return null;
Expand Down
26 changes: 1 addition & 25 deletions controllers/bluesky/job-runner.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { trackEvent } from "@/services/analytics";
import { PlausibleEvents } from "@/types/analytics";

import type { BlueskyAccountController } from "../BlueskyAccountController";
import type { BlueskyJobRecord, BlueskyJobType, JobEmit } from "./job-types";
import type { BlueskyJobRecord, JobEmit } from "./job-types";
import { runDeleteBookmarksJob } from "./jobs/delete-bookmarks";
import { runDeleteLikesJob } from "./jobs/delete-likes";
import { runDeleteMessagesJob } from "./jobs/delete-messages";
Expand All @@ -16,32 +13,11 @@ import { runSavePostsJob } from "./jobs/save-posts";
import { runUnfollowUsersJob } from "./jobs/unfollow-users";
import { runVerifyAuthorizationJob } from "./jobs/verify-authorization";

/**
* Map of job types to their corresponding Plausible event names
*/
const JOB_TYPE_TO_EVENT: Partial<
Record<BlueskyJobType, (typeof PlausibleEvents)[keyof typeof PlausibleEvents]>
> = {
verifyAuthorization: PlausibleEvents.BLUESKY_JOB_STARTED_VERIFY_AUTHORIZATION,
savePosts: PlausibleEvents.BLUESKY_JOB_STARTED_SAVE_POSTS,
saveLikes: PlausibleEvents.BLUESKY_JOB_STARTED_SAVE_LIKES,
saveBookmarks: PlausibleEvents.BLUESKY_JOB_STARTED_SAVE_BOOKMARKS,
saveChatConvos: PlausibleEvents.BLUESKY_JOB_STARTED_SAVE_CHAT_CONVOS,
saveChatMessages: PlausibleEvents.BLUESKY_JOB_STARTED_SAVE_CHAT_MESSAGES,
// Delete job events can be added later when analytics are set up for them
};

export async function runJob(
controller: BlueskyAccountController,
job: BlueskyJobRecord,
emit: JobEmit
): Promise<void> {
// Track the job start event
const eventName = JOB_TYPE_TO_EVENT[job.jobType];
if (eventName) {
trackEvent(eventName);
}

const handlers: Partial<
Record<BlueskyJobRecord["jobType"], () => Promise<void>>
> = {
Expand Down
2 changes: 0 additions & 2 deletions services/__tests__/bluesky-sign-in.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jest.mock("@/controllers", () => ({
),
}));

jest.mock("@/services/analytics", () => ({ trackEvent: jest.fn() }));

import { withBlueskyController } from "@/controllers";
import type { AccountListItem } from "@/database/accounts";
import { verifyBlueskyAccountAuthStatus } from "@/services/bluesky-account-auth-status";
Expand Down
63 changes: 0 additions & 63 deletions services/analytics.ts

This file was deleted.

3 changes: 0 additions & 3 deletions services/bluesky-sign-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import {
type AccountAuthStatusValue,
} from "@/controllers";
import type { AccountListItem } from "@/database/accounts";
import { trackEvent } from "@/services/analytics";
import { verifyBlueskyAccountAuthStatus } from "@/services/bluesky-account-auth-status";
import { authenticateBlueskyAccount } from "@/services/bluesky-oauth";
import { PlausibleEvents } from "@/types/analytics";

/**
* Establish a Bluesky connection and leave the account knowing it has one.
Expand Down Expand Up @@ -43,7 +41,6 @@ export async function connectBlueskyAccount(
handle: string,
): Promise<BlueskySignIn> {
const account = await authenticateBlueskyAccount(handle);
trackEvent(PlausibleEvents.BLUESKY_USER_SIGNED_IN);

let status: AccountAuthStatusValue = ACCOUNT_AUTH_STATUS.signedOut;
try {
Expand Down
25 changes: 0 additions & 25 deletions types/analytics.ts

This file was deleted.

Loading