Conversation
🦋 Changeset detectedLatest commit: f0a54fc The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello @dieguezguille, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the application's Intercom integration by introducing conditional API key selection based on the deployment environment, allowing for distinct Intercom workspaces for different application domains. It also refines the server's test configuration with a more specific Intercom identity key, ensuring robust testing of Intercom-related functionalities. These changes facilitate better environment management and testing practices for Intercom services. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
WalkthroughThe changes add support for test workspace Intercom keys to the mobile app. The Intercom configuration now conditionally selects API keys based on the deployment domain, and a test environment variable for Intercom identity is updated in the Vitest configuration. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds Intercom keys for a test workspace. While the changes in app.config.ts for public keys are acceptable and follow the existing code style, a critical security issue has been identified in server/vitest.config.mts. A secret Intercom identity key has been hardcoded, which poses a significant security risk. My review includes a comment with a suggestion to load this key from environment variables to mitigate this vulnerability.
| BRIDGE_API_URL: "https://bridge.test", | ||
| EXPO_PUBLIC_ALCHEMY_API_KEY: " ", | ||
| INTERCOM_IDENTITY_KEY: "intercom", | ||
| INTERCOM_IDENTITY_KEY: "a9cBeTfEtGPSQ58REZP35Bx00ofajvStEc8TTuBtSmk", |
There was a problem hiding this comment.
A secret key (INTERCOM_IDENTITY_KEY) is hardcoded in this test configuration. Committing secrets to source control is a major security risk, even for test environments. This key should be loaded from environment variables instead. This prevents secrets from being exposed in the repository's history.
INTERCOM_IDENTITY_KEY: env.INTERCOM_IDENTITY_KEY ?? "",
|
✅ All tests passed. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app.config.ts`:
- Around line 96-103: Extract the repeated domain check env.APP_DOMAIN ===
"web.exactly.app" into a single local boolean (e.g., const isProduction =
env.APP_DOMAIN === "web.exactly.app") declared near the top of the config, then
replace each inline check used to set androidApiKey and iosApiKey (and any other
Intercom/plugin usage) with isProduction to ensure consistency and reduce
duplication.
| androidApiKey: | ||
| env.APP_DOMAIN === "web.exactly.app" | ||
| ? "android_sdk-d602d62cbdb9e8e0a6f426db847ddc74d2e26090" | ||
| : "android_sdk-e98928bdde6eeb08efe3c1a1f683756b98fc1ba1", | ||
| iosApiKey: | ||
| env.APP_DOMAIN === "web.exactly.app" | ||
| ? "ios_sdk-ad6831098d9c2d69bd98e92a5ad7a4f030472a92" | ||
| : "ios_sdk-53eec69c747965af2ed69c8e0454b381f04feb86", |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider extracting the repeated domain check into a local constant.
env.APP_DOMAIN === "web.exactly.app" now appears three times (line 20, 97, 101). A single const isProduction = … near line 18–20 would keep all three usages in sync and reduce the chance of a future mismatch.
♻️ Proposed refactor
Near the top (around lines 18–20):
if (env.EAS_BUILD_RUNNER === "eas-build") env.APP_DOMAIN ??= "web.exactly.app";
if (env.APP_DOMAIN) env.EXPO_PUBLIC_DOMAIN = env.APP_DOMAIN;
-env.EXPO_PUBLIC_INTERCOM_APP_ID ??= env.APP_DOMAIN === "web.exactly.app" ? "eknd6y0s" : "pxd0wo85"; // cspell:ignore eknd6y0s
+const isProduction = env.APP_DOMAIN === "web.exactly.app";
+env.EXPO_PUBLIC_INTERCOM_APP_ID ??= isProduction ? "eknd6y0s" : "pxd0wo85"; // cspell:ignore eknd6y0sThen in the Intercom plugin block:
- androidApiKey:
- env.APP_DOMAIN === "web.exactly.app"
- ? "android_sdk-d602d62cbdb9e8e0a6f426db847ddc74d2e26090"
- : "android_sdk-e98928bdde6eeb08efe3c1a1f683756b98fc1ba1",
- iosApiKey:
- env.APP_DOMAIN === "web.exactly.app"
- ? "ios_sdk-ad6831098d9c2d69bd98e92a5ad7a4f030472a92"
- : "ios_sdk-53eec69c747965af2ed69c8e0454b381f04feb86",
+ androidApiKey: isProduction
+ ? "android_sdk-d602d62cbdb9e8e0a6f426db847ddc74d2e26090"
+ : "android_sdk-e98928bdde6eeb08efe3c1a1f683756b98fc1ba1",
+ iosApiKey: isProduction
+ ? "ios_sdk-ad6831098d9c2d69bd98e92a5ad7a4f030472a92"
+ : "ios_sdk-53eec69c747965af2ed69c8e0454b381f04feb86",🤖 Prompt for AI Agents
In `@app.config.ts` around lines 96 - 103, Extract the repeated domain check
env.APP_DOMAIN === "web.exactly.app" into a single local boolean (e.g., const
isProduction = env.APP_DOMAIN === "web.exactly.app") declared near the top of
the config, then replace each inline check used to set androidApiKey and
iosApiKey (and any other Intercom/plugin usage) with isProduction to ensure
consistency and reduce duplication.
Summary by CodeRabbit