Repository navigation
fix analytics warnings in metro logs - #476
islandbitcoin wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes analytics warnings in metro logs by migrating from deprecated Firebase SDK default imports to the new v6+ modular SDK functions. The changes update all Firebase-related imports across analytics, crashlytics, messaging, app-check, and remote-config modules to use the new function-based API.
Key Changes
- Updated Firebase SDK imports to use modular functions instead of default imports
- Fixed Xcode project file to replace "(null)" placeholders with proper "BuildFile" entries
- Added new social posting functionality with Nostr integration
- Created shared Nostr pool instance to prevent connection leaks
Reviewed Changes
Copilot reviewed 48 out of 51 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated @react-native-firebase/messaging to v23.2.0 |
| ios/LNFlash.xcodeproj/project.pbxproj | Fixed "(null)" placeholders in BuildFile references |
| app/utils/notifications.ts | Migrated to getMessaging() and getCrashlytics() functions |
| app/utils/analytics.ts | Updated all analytics calls to use getAnalytics() |
| app/utils/nostr/pool.ts | Created shared SimplePool instance |
| Multiple screen files | Updated Firebase imports throughout the codebase |
| app/screens/social/post.tsx | New Nostr social posting functionality |
| app/i18n/ files | Added localization strings for social features |
| app/components/nostr-quickstart/ | New component for Nostr onboarding |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| export const setPreferredRelay = async (secretKey?: Uint8Array) => { | ||
| let pool = new SimplePool() | ||
| let secret: Uint8Array | null = null |
There was a problem hiding this comment.
The removed SimplePool instantiation could lead to connection leaks. Since a shared pool is now used from './nostr/pool', ensure the pool connections are properly managed elsewhere in the application lifecycle.
| const fetchNostrUser = async (npub: `npub1${string}`) => { | ||
| const pool = new SimplePool() | ||
| const nostrProfile = await pool.get(relays, { | ||
| kinds: [0], | ||
| authors: [nip19.decode(npub).data], |
There was a problem hiding this comment.
The removed pool.close(relays) call could lead to connection leaks. With the shared pool instance, consider implementing proper connection cleanup at the application level or adding connection management logic.
| const signedKind0Event = finalizeEvent(kind0Event, secret) | ||
| let messages = await Promise.any(pool.publish(publicRelays, signedKind0Event)) | ||
| console.log("PUblished, messages from relays are", messages) |
There was a problem hiding this comment.
Another removed pool.close(publicRelays) call that could lead to connection leaks. The shared pool pattern requires careful connection lifecycle management to prevent resource leaks.
| @@ -1,5 +1,6 @@ | |||
| // prettier-ignore | |||
|
|
|||
| import NostrQuickStart from "@app/components/nostr-quickstart" | |||
There was a problem hiding this comment.
This import statement is unused in the translation file and appears to be incorrectly placed. Translation files should only contain translation data, not component imports.
| import NostrQuickStart from "@app/components/nostr-quickstart" |
| import { PrimaryBtn } from "@app/components/buttons" | ||
| import { useI18nContext } from "@app/i18n/i18n-react" | ||
|
|
||
| import { nip19, getPublicKey, finalizeEvent, Relay, SimplePool } from "nostr-tools" |
There was a problem hiding this comment.
The SimplePool import is unused since the shared pool from '@app/utils/nostr/pool' is being used. Remove the unused import.
| import { nip19, getPublicKey, finalizeEvent, Relay, SimplePool } from "nostr-tools" | |
| import { nip19, getPublicKey, finalizeEvent, Relay } from "nostr-tools" |
|
|
||
| const FIXED_TEXT_LINE_2 = "#introductions" | ||
|
|
||
| const MakeNostrPost = ({ privateKey }: { privateKey: string }) => { |
There was a problem hiding this comment.
The privateKey prop is defined but never used in the component. The component calls getSecretKey() instead. Either use the prop or remove it from the interface.
| const MakeNostrPost = ({ privateKey }: { privateKey: string }) => { | |
| const MakeNostrPost = () => { |
Co-authored-by: Copilot <[email protected]>
|
@islandbitcoin this PR includes changes from another PR |
|
Opened another PR including only firebase changes |
No description provided.