-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore: add firebase appcheck dep #1269
Changes from 25 commits
7e76a17
081a4a1
33cf1da
e7f8d16
5020135
9efe115
da3b245
d41ec83
4d01e3a
07f339e
ecd6480
3b405a1
c81b6ee
88d08c1
b2b680b
580f152
7719deb
4d9c3f8
5f6e52e
90ecb17
aeb5055
739d194
f00427e
6fcf2f5
470dff4
92af7ce
72e4120
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "23052121755", | ||
"project_id": "converse-appcheck", | ||
"storage_bucket": "converse-appcheck.firebasestorage.app" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:23052121755:android:1787e5971de11f3d13f83e", | ||
"android_client_info": { | ||
"package_name": "com.converse.dev" | ||
} | ||
}, | ||
"oauth_client": [], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyCYQ3mVhPmGWFYvX9SpEKN4cA6XpdsOC9I" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [] | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,16 +10,16 @@ import Alamofire | |||||
|
||||||
func getProfile(account: String, address: String) async -> Profile? { | ||||||
var profileState = getProfilesStore(account: account)?.state | ||||||
let formattedAddress = address.lowercased() | ||||||
if let profile = profileState?.profiles?[address] ?? profileState?.profiles?[formattedAddress] { | ||||||
let lowercasedAddress = address.lowercased() | ||||||
if let profile = profileState?.profiles?[address] ?? profileState?.profiles?[lowercasedAddress] ?? profileState?.profiles?[lowercasedAddress] { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove redundant profile lookup conditions The current implementation checks Simplify the condition: - if let profile = profileState?.profiles?[address] ?? profileState?.profiles?[lowercasedAddress] ?? profileState?.profiles?[lowercasedAddress] {
+ if let profile = profileState?.profiles?[address] ?? profileState?.profiles?[lowercasedAddress] { 📝 Committable suggestion
Suggested change
|
||||||
return profile | ||||||
} | ||||||
|
||||||
// If profile is nil, let's refresh it | ||||||
try? await refreshProfileFromBackend(account: account, address: formattedAddress) | ||||||
try? await refreshProfileFromBackend(account: account, address: lowercasedAddress) | ||||||
|
||||||
profileState = getProfilesStore(account: account)?.state | ||||||
if let profile = profileState?.profiles?[formattedAddress] { | ||||||
if let profile = profileState?.profiles?[lowercasedAddress] { | ||||||
return profile | ||||||
} | ||||||
return nil | ||||||
|
@@ -53,3 +53,4 @@ func refreshProfileFromBackend(account: String, address: String) async throws { | |||||
} | ||||||
|
||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>API_KEY</key> | ||
<string>AIzaSyABJ4xiJDqhKhu4x0eCE2ub9h0gBSDIRg8</string> | ||
<key>GCM_SENDER_ID</key> | ||
<string>23052121755</string> | ||
<key>PLIST_VERSION</key> | ||
<string>1</string> | ||
<key>BUNDLE_ID</key> | ||
<string>com.converse.preview</string> | ||
<key>PROJECT_ID</key> | ||
<string>converse-appcheck</string> | ||
<key>STORAGE_BUCKET</key> | ||
<string>converse-appcheck.firebasestorage.app</string> | ||
<key>IS_ADS_ENABLED</key> | ||
<false></false> | ||
<key>IS_ANALYTICS_ENABLED</key> | ||
<false></false> | ||
<key>IS_APPINVITE_ENABLED</key> | ||
<true></true> | ||
<key>IS_GCM_ENABLED</key> | ||
<true></true> | ||
<key>IS_SIGNIN_ENABLED</key> | ||
<true></true> | ||
<key>GOOGLE_APP_ID</key> | ||
<string>1:23052121755:ios:832b219466063d0113f83e</string> | ||
</dict> | ||
</plist> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Fix Firebase initialization order and ensure main thread execution
The environment-specific configuration suggestion should be removed as there's only a single
GoogleService-Info.plist
file in the project. However, the other concerns about initialization order and thread safety remain valid.Here's the corrected suggestion:
🔗 Analysis chain
Fix Firebase initialization order and add error handling.
There are several issues with the current initialization:
Here's the suggested fix:
Let's verify the environment configuration setup:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 201
Script:
Length of output: 263