Skip to content

Commit 5f1277e

Browse files
committed
Merge branch 'dev' into ya/clean-china-cicd
2 parents 1b18813 + 3b6a50a commit 5f1277e

File tree

111 files changed

+3825
-3672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+3825
-3672
lines changed

asg_client/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ android {
7575

7676
minSdk 28
7777
targetSdk 33
78-
versionCode 16
79-
versionName "16.0"
78+
versionCode 17
79+
versionName "17.0"
8080

8181
ndk {
8282
abiFilters "armeabi-v7a", "arm64-v8a"

asg_client/app/src/main/java/com/mentra/asg_client/service/core/AsgClientService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,6 @@ public void sendVersionInfo() {
852852
try {
853853
JSONObject versionInfo = new JSONObject();
854854
versionInfo.put("type", "version_info");
855-
versionInfo.put("timestamp", System.currentTimeMillis());
856855

857856
String appVersion = "1.0.0";
858857
String buildNumber = "1";

asg_client/app/src/main/java/com/mentra/asg_client/service/core/handlers/VersionCommandHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ private void sendVersionInfo() {
8686
try {
8787
JSONObject versionInfo = new JSONObject();
8888
versionInfo.put("type", "version_info");
89-
versionInfo.put("timestamp", System.currentTimeMillis());
9089

9190
String appVersion = "1.0.0";
9291
String buildNumber = "1";

bun.lock

Lines changed: 17 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ PORT=80
88

99
ADMIN_EMAILS=alex1115alex@gmail.com,alex1115alex+tester@gmail.com,isaiah@mentra.glass,israelov@mentra.glass,cayden@mentra.glass,nicolo@mentra.glass,nirhbay@mentra.glass,roger@mentra.glass
1010

11+
# Additional Pre-installed Apps (optional, comma-separated package names)
12+
# These apps will be added on top of the default pre-installed apps
13+
# Example: ADDITIONAL_PRE_INSTALLED_APPS=com.mentra.mentraai.beta,com.custom.app
14+
ADDITIONAL_PRE_INSTALLED_APPS=
15+
16+
# Auto-delete Apps (optional, comma-separated package names)
17+
# Apps specified here will be automatically removed from users' installed apps when they connect
18+
# Useful for deprecating or removing apps across all users
19+
# Example: DELETE_APP_BY_PACKAGE_NAME=cloud.augmentos.mira,com.deprecated.app
20+
DELETE_APP_BY_PACKAGE_NAME=
21+
1122
# Services URLs
1223
CLOUD_URL=cloud
1324
APPSTORE_URL=appstore

cloud/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@ graph TD
192192
This project is licensed under the MIT License - see the [LICENSE](../LICENSE) file for details.
193193

194194
Update the below count to trigger CI/CD cloud redeployment without making any real code changes.
195-
Redeploy cloud: 1
195+
Redeploy cloud: 3

cloud/packages/cloud/src/models/user.model.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,50 @@ UserSchema.statics.findOrCreateUser = async function (
814814
// Don't fail user creation if app installation fails
815815
}
816816

817+
// Auto-delete apps specified in DELETE_APP_BY_PACKAGE_NAME environment variable
818+
try {
819+
const deletePackageNames = process.env.DELETE_APP_BY_PACKAGE_NAME;
820+
821+
if (deletePackageNames && deletePackageNames.trim()) {
822+
const packagesToDelete = deletePackageNames
823+
.split(",")
824+
.map((pkg) => pkg.trim())
825+
.filter((pkg) => pkg.length > 0);
826+
827+
if (packagesToDelete.length > 0 && user.installedApps) {
828+
const deletedApps: string[] = [];
829+
830+
// Filter out apps that should be deleted
831+
user.installedApps = user.installedApps.filter((app: any) => {
832+
const shouldDelete = packagesToDelete.includes(app.packageName);
833+
if (shouldDelete) {
834+
deletedApps.push(app.packageName);
835+
}
836+
return !shouldDelete;
837+
});
838+
839+
// Only save if we actually deleted something
840+
if (deletedApps.length > 0) {
841+
await user.save();
842+
logger.info(
843+
{
844+
email,
845+
deletedApps,
846+
deletedCount: deletedApps.length,
847+
},
848+
`Auto-deleted ${deletedApps.length} app(s) for user: ${email}`,
849+
);
850+
}
851+
}
852+
}
853+
} catch (error) {
854+
{
855+
const err = error instanceof Error ? error : new Error(String(error));
856+
logger.error(err, "Error auto-deleting apps:");
857+
}
858+
// Don't fail user creation if app deletion fails
859+
}
860+
817861
return user;
818862
};
819863

cloud/packages/cloud/src/routes/apps.routes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const ALLOWED_API_KEY_PACKAGES = [
3434
"test.augmentos.mira",
3535
"cloud.augmentos.mira",
3636
"com.augmentos.mira",
37+
"com.mentra.mentraai.beta",
38+
// "com.mentra.mentraai.dev", //later
39+
// "com.mentra.mentraai" //later
40+
3741
];
3842

3943
const AUGMENTOS_AUTH_JWT_SECRET = process.env.AUGMENTOS_AUTH_JWT_SECRET || "";

cloud/packages/cloud/src/services/core/app.service.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const SYSTEM_DASHBOARD_PACKAGE_NAME =
3232
export const PRE_INSTALLED = [
3333
"com.augmentos.livecaptions",
3434
"cloud.augmentos.notify",
35-
"cloud.augmentos.mira",
35+
// "cloud.augmentos.mira",
3636
];
3737
export const PRE_INSTALLED_DEBUG = [
3838
// "com.mentra.link",
@@ -51,18 +51,31 @@ export const PRE_INSTALLED_DEBUG = [
5151

5252
// export const PRE_INSTALLED = ["cloud.augmentos.live-captions-global", "cloud.augmentos.notify", "cloud.augmentos.mira"];
5353

54+
// Add debug apps in non-production environments
5455
if (
5556
process.env.NODE_ENV !== "production" ||
5657
process.env.DEBUG_APPS === "true"
5758
) {
58-
// If we're in debug mode, add the debug apps to the preinstalled list.
5959
PRE_INSTALLED.push(...PRE_INSTALLED_DEBUG);
6060
logger.info(
6161
{ PRE_INSTALLED_DEBUG },
6262
"Debug mode enabled - adding debug apps to preinstalled list:",
6363
);
6464
}
6565

66+
// Add additional pre-installed apps from environment variable
67+
if (process.env.ADDITIONAL_PRE_INSTALLED_APPS) {
68+
const additionalApps = process.env.ADDITIONAL_PRE_INSTALLED_APPS.split(",")
69+
.map((app) => app.trim())
70+
.filter((app) => app.length > 0);
71+
72+
PRE_INSTALLED.push(...additionalApps);
73+
logger.info(
74+
{ additionalApps },
75+
"Adding additional pre-installed apps from ADDITIONAL_PRE_INSTALLED_APPS:",
76+
);
77+
}
78+
6679
// If we're in test mode, we don't want to pre-install any apps. (used with the headless client for testing)
6780
if (process.env.NODE_ENV === "test") {
6881
logger.info("Test mode - no pre-installed apps");

eslint.config.mjs

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,29 @@ import pluginReactNative from "eslint-plugin-react-native"
66
import pluginReactotron from "eslint-plugin-reactotron"
77
import pluginPrettier from "eslint-plugin-prettier"
88
import prettierConfig from "eslint-config-prettier"
9-
import pluginImport from "eslint-plugin-import"
9+
import expoConfig from "eslint-config-expo/flat.js"
10+
import {defineConfig} from "eslint/config"
1011

11-
export default [
12-
// Base config for all JS/TS files
12+
export default defineConfig([
13+
14+
// Recommended configs
15+
expoConfig,
16+
js.configs.recommended,
17+
...tseslint.configs.recommended,
18+
pluginReact.configs.flat.recommended,
19+
pluginReact.configs.flat["jsx-runtime"],
20+
prettierConfig,
21+
22+
// custom config:
1323
{
1424
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
15-
ignores: ["eslint.config.mjs"],
25+
ignores: ["eslint.config.mjs", "metro.config.js"],
1626
plugins: {
1727
"@typescript-eslint": tseslint.plugin,
1828
"react": pluginReact,
1929
"react-native": pluginReactNative,
2030
"reactotron": pluginReactotron,
2131
"prettier": pluginPrettier,
22-
"import": pluginImport,
2332
},
2433
languageOptions: {
2534
globals: {
@@ -37,25 +46,11 @@ export default [
3746
react: {
3847
version: "detect", // Automatically detect the React version
3948
},
40-
},
41-
},
42-
43-
// Recommended configs
44-
js.configs.recommended,
45-
...tseslint.configs.recommended,
46-
pluginReact.configs.flat.recommended,
47-
pluginReact.configs.flat["jsx-runtime"],
48-
prettierConfig,
49-
50-
// All rule overrides in one place
51-
{
52-
plugins: {
53-
"@typescript-eslint": tseslint.plugin,
54-
"react": pluginReact,
55-
"react-native": pluginReactNative,
56-
"reactotron": pluginReactotron,
57-
"prettier": pluginPrettier,
58-
"import": pluginImport,
49+
"import/resolver": {
50+
typescript: {
51+
project: ["./mobile/tsconfig.json", "./cloud/tsconfig.json"],
52+
},
53+
},
5954
},
6055
rules: {
6156
// Prettier
@@ -195,4 +190,4 @@ export default [
195190
"mobile/**/*.aab",
196191
],
197192
},
198-
]
193+
])

0 commit comments

Comments
 (0)