Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appcheck #1375

Merged
merged 41 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e3a7113
feat: appcheck
technoplato Dec 17, 2024
83ffcae
fix ios build issue
technoplato Dec 17, 2024
c080ea9
auth/config fixes
technoplato Dec 18, 2024
ad52d21
todo
technoplato Dec 18, 2024
502c921
revert attempted fix
technoplato Dec 18, 2024
3b5f901
revert to info.plist firebase initialization
technoplato Dec 18, 2024
f9c7064
fix pod install bug again
technoplato Dec 18, 2024
7236612
initialization is too cumbersome for now and these are safe to commit…
technoplato Dec 18, 2024
d74a82c
firebase plist files in source control for simplicity - can revisit l…
technoplato Dec 18, 2024
3de6015
Merge branch 'release/3.0.0' into ml/appcheck
technoplato Dec 18, 2024
71f3b2e
typescript fixes
technoplato Dec 18, 2024
c664b28
remove firebase instructions
technoplato Dec 18, 2024
42e50e0
Update AppDelegate.mm
technoplato Dec 18, 2024
d70c25d
Update Podfile
technoplato Dec 18, 2024
29fa001
Update NewAccountEphemeraScreen.tsx
technoplato Dec 18, 2024
0029bbe
chatgpt assisted fixes
technoplato Dec 18, 2024
80e5789
update pods to match podfile lock in eas
technoplato Dec 18, 2024
e89a8d0
pr feedback
technoplato Dec 19, 2024
8a41db6
Merge branch 'release/3.0.0' into ml/appcheck-build-fix-trials
technoplato Dec 19, 2024
9630217
code cleanup
technoplato Dec 19, 2024
a732353
Merge branch 'release/3.0.0' into ml/appcheck-build-fix-trials
technoplato Dec 19, 2024
26398a4
Merge branch 'release/3.0.0' into ml/appcheck-build-fix-trials
technoplato Dec 19, 2024
c7e456e
Merge branch 'release/3.0.0' into ml/appcheck-build-fix-trials
technoplato Dec 19, 2024
1e571ba
Merge branch 'release/3.0.0' into ml/appcheck-build-fix-trials
technoplato Dec 19, 2024
3087cdb
upgrade bundler;ruby
technoplato Dec 19, 2024
c6a4022
Merge branch 'release/3.0.0' into ml/appcheck-build-fix-trials
technoplato Dec 19, 2024
7393f7c
Update JoinGroup.client.ts
technoplato Dec 19, 2024
780e159
Merge branch 'release/3.0.0' into ml/appcheck-build-fix-trials
technoplato Dec 19, 2024
159e29b
Merge branch 'release/3.0.0' into appcheck-upgrade-ruby-bundler
technoplato Dec 19, 2024
a2f40e4
Update JoinGroup.client.ts
technoplato Dec 19, 2024
aeab4ec
asdf
technoplato Dec 19, 2024
e8b6510
Merge branch 'appcheck-upgrade-ruby-bundler' into ml/fix-android-buil…
technoplato Dec 20, 2024
16ff4f5
add android appcheck debug token
technoplato Dec 20, 2024
bab6fb1
Merge branch 'release/3.0.0' into ml/appcheck-build-fix-trials
technoplato Dec 20, 2024
be5749d
fix ios physical device -> local backend; cleanup env management; che…
technoplato Dec 20, 2024
b2eb80b
use env utils everywhere
technoplato Dec 20, 2024
b7f25f2
fix typescript; rename var
technoplato Dec 20, 2024
b10e014
im dumb and app.config.ts can't import typescript
technoplato Dec 20, 2024
ea353a0
script to send apk to android physical device
technoplato Dec 20, 2024
991f68c
update exit codes
technoplato Dec 20, 2024
184a1d7
fix auth deduping
technoplato Dec 20, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ ios/Converse.xcworkspace/xcshareddata/swiftpm/Package.resolved

# Android
/android/
build-*.apk
5 changes: 5 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import { initSentry } from "./utils/sentry";
import "./utils/splash/splash";
import "./features/notifications/utils";
import { setupAppAttest } from "@utils/appCheck";

LogBox.ignoreLogs([
"Privy: Expected status code 200, received 400", // Privy
Expand All @@ -65,6 +66,10 @@
const styles = useStyles();
const debugRef = useRef();

useEffect(() => {
setupAppAttest();
}, []);

useCoinbaseWalletListener(true, coinbaseUrl);

useEffect(() => {
Expand All @@ -72,10 +77,10 @@
}, []);

const showDebugMenu = useCallback(() => {
if (!debugRef.current || !(debugRef.current as any).showDebugMenu) {

Check warning on line 80 in App.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
return;
}
(debugRef.current as any).showDebugMenu();

Check warning on line 83 in App.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
}, []);

useEffect(() => {
Expand Down Expand Up @@ -119,7 +124,7 @@
const AppKeyboardProvider =
Platform.OS === "ios" ? KeyboardProvider : React.Fragment;

export default function AppWithProviders() {

Check warning on line 127 in App.tsx

View workflow job for this annotation

GitHub Actions / lint

Prefer named exports
const colorScheme = useColorScheme();

const paperTheme = useMemo(() => {
Expand All @@ -137,7 +142,7 @@
<ActionSheetProvider>
<ThemeProvider value={{ themeScheme, setThemeContextOverride }}>
<PaperProvider theme={paperTheme}>
<GestureHandlerRootView style={{ flex: 1 }}>

Check warning on line 145 in App.tsx

View workflow job for this annotation

GitHub Actions / lint

Inline style: { flex: 1 }
<BottomSheetModalProvider>
<PortalProvider>
<App />
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ Until then Converse web will only show 1 to 1 conversations and the majority of
Web support is an end goal and the team is happy to fix any issues that are reported

### Install JS/React Native Dependencies

```
yarn
```

### Building the Web App

```
yarn start
```
Expand All @@ -72,13 +74,15 @@ yarn start
```

# Linting

```
yarn lint
```

# Testing

## Running Jest tests

Before running the tests make sure that you have a `.env` file setup with the variables variable set

```sh
Expand All @@ -88,13 +92,15 @@ yarn test
## Running Performance Tests

Capture baselines for performance tests

```sh
yarn test:perf:baseline
```

Make changes to the code to see the performance impact

Run the performance tests again to see the changes

```sh
yarn test:perf
```
Expand All @@ -103,22 +109,22 @@ yarn test:perf

Frames are expected to follow the Open Frames Standard https://github.com/open-frames/standard



# Release Processes

### Main Branch

Represents the current production code.

### Release Branches

Each release branch is based off of `main` or the release branch before it. It is used to prepare and stabilize the code for a specific release version (e.g., `release/2.0.8`).

### Feature Branches

Feature branches are longer-lived features or refactors expected to take additional time. They should be based off of the targeted feature release branch.

This structure allows code to flow **from `main` to release branches to feature branches**.


![Merge Diagram](docs/image.png)

---
Expand All @@ -128,6 +134,7 @@ This structure allows code to flow **from `main` to release branches to feature
Assuming your branch is `feature/scw`, and your feature is targeted for release `2.1.0`, follow these steps to rebase:

1. First, checkout the feature branch:

```bash
git fetch origin
git branch feature/scw -D
Expand All @@ -141,7 +148,9 @@ Assuming your branch is `feature/scw`, and your feature is targeted for release
```

### Exceptions

There are certain times where this flow does not work as intended. For example:
* Build scripts: These may need to be run off of the default main branch instead of feature or release branches.
* Read me updates: These are not required to be on a branch and can be committed directly to main.
* Bug fixes that can be OTA updated: These can be committed directly to main to perform an OTA update.

- Build scripts: These may need to be run off of the default main branch instead of feature or release branches.
- Read me updates: These are not required to be on a branch and can be committed directly to main.
- Bug fixes that can be OTA updated: These can be committed directly to main to perform an OTA update.
2 changes: 2 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import appBuildNumbers from "./app.json";

const env = process.env as any;

Check warning on line 8 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
const isDev = env.EXPO_ENV === "dev";

warnOnce(
isDev && !(process.env as any).EXPO_PUBLIC_DEV_API_URI,

Check warning on line 12 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
"\n\n🚧 Running the app without EXPO_PUBLIC_DEV_API_URI setup\n\n"
);

Expand All @@ -36,7 +36,7 @@
? "preview.getconverse.app"
: "getconverse.app";

export default ({ config }: ConfigContext): ExpoConfig => ({

Check warning on line 39 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Prefer named exports
...config,
name: isDev ? "Converse DEV" : isPreview ? "Converse PREVIEW" : "Converse",
scheme: isDev ? "converse-dev" : isPreview ? "converse-preview" : "converse",
Expand Down Expand Up @@ -233,6 +233,8 @@
url: "https://sentry.io/",
},
],
["@react-native-firebase/app-check"],

"./scripts/build/android/notifeeExpoPlugin.js", // See https://github.com/invertase/notifee/issues/350
"./scripts/build/android/androidDependenciesExpoPlugin.js", // Handle some conflicting dependencies manually
"./scripts/build/android/buildGradleProperties.js", // Increase memory for building android in EAS
Expand Down
24 changes: 16 additions & 8 deletions config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { DEFAULT_SUPPORTED_CHAINS } from "@utils/evm/wallets";
import { XmtpEnv } from "@xmtp/xmtp-js";
import Constants from "expo-constants";
import { Platform } from "react-native";
import { base, baseSepolia } from "wagmi/chains";
import { getApiUri } from "./utils/apiConfig";
import { Environments, isDev, isPreview } from "./utils/getEnv";

declare const process: {
env: {
Expand Down Expand Up @@ -53,12 +54,14 @@ const defaultConfig = {

const isAndroid = Platform.OS === "android";

const apiURI = getApiUri();

const ENV = {
dev: {
...defaultConfig,
env: "dev",
apiURI,
env: Environments.dev,
xmtpEnv: (process.env.EXPO_PUBLIC_DEV_XMTP_ENV || "dev") as XmtpEnv,
apiURI: process.env.EXPO_PUBLIC_DEV_API_URI || "",
debugMenu: true,
bundleId: "com.converse.dev",
appleAppGroup: "group.com.converse.dev",
Expand All @@ -70,10 +73,13 @@ const ENV = {
),
alphaGroupChatUrl:
"https://converse.xyz/group-invite/UDv3aYZONQGc6_XPJY6Ch",
appCheckDebugToken: isAndroid
? process.env.EXPO_PUBLIC_FIREBASE_APP_CHECK_DEBUG_TOKEN_ANDROID
: process.env.EXPO_PUBLIC_FIREBASE_APP_CHECK_DEBUG_TOKEN_IOS,
},
preview: {
...defaultConfig,
env: "preview",
env: Environments.preview,
xmtpEnv: "dev",
apiURI: "https://backend-staging.converse.xyz",
debugMenu: true,
Expand All @@ -88,10 +94,11 @@ const ENV = {
].flatMap((domain) => [`https://${domain}`, `http://${domain}`, domain]),
alphaGroupChatUrl:
"https://converse.xyz/group-invite/eQAvo-WvwrdBTsHINuSMJ",
appCheckDebugToken: undefined,
},
prod: {
...defaultConfig,
env: "prod",
env: Environments.prod,
xmtpEnv: "production",
apiURI: "https://backend-prod.converse.xyz",
debugMenu: false,
Expand Down Expand Up @@ -121,13 +128,14 @@ const ENV = {
},
alphaGroupChatUrl:
"https://converse.xyz/group-invite/eQAvo-WvwrdBTsHINuSMJ",
appCheckDebugToken: undefined,
},
} as const;

const getConfig = () => {
if (__DEV__) {
export const getConfig = () => {
if (isDev) {
return ENV.dev;
} else if (Constants.expoConfig?.extra?.ENV === "preview") {
} else if (isPreview) {
return ENV.preview;
} else {
return ENV.prod;
Expand Down
4 changes: 2 additions & 2 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"node": "20.15.1",
"ios": {
"cocoapods": "1.14.3"
"cocoapods": "1.16.2"
},
"android": {
"resourceClass": "medium"
Expand All @@ -29,7 +29,7 @@
"node": "20.15.1",
"ios": {
"resourceClass": "large",
"cocoapods": "1.14.3"
"cocoapods": "1.16.2"
}
},
"production-android": {
Expand Down
1 change: 0 additions & 1 deletion features/GroupInvites/joinGroup/JoinGroup.client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { IGroupConsentOptions } from "@hooks/useGroupConsent";
import { createGroupJoinRequest, getGroupJoinRequest } from "@utils/api";
import { GroupInvite } from "@utils/api.types";
// import { getGroupIdFromTopic } from "@utils/groupUtils/groupId";
import { getV3IdFromTopic } from "@/utils/groupUtils/groupId";
import logger from "@utils/logger";
import {
Expand Down
Loading
Loading