Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2835752
D12552.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D12552.diff
View Options
diff --git a/native/android/app/src/main/java/app/comm/android/commservices/CommAndroidBlobClient.java b/native/android/app/src/main/java/app/comm/android/commservices/CommAndroidBlobClient.java
--- a/native/android/app/src/main/java/app/comm/android/commservices/CommAndroidBlobClient.java
+++ b/native/android/app/src/main/java/app/comm/android/commservices/CommAndroidBlobClient.java
@@ -88,9 +88,10 @@
String accessToken = CommSecureStore.get("accessToken");
String deviceID = CommSecureStore.get("deviceID");
- userID = userID == null ? "" : userID;
- accessToken = accessToken == null ? "" : accessToken;
- deviceID = deviceID == null ? "" : deviceID;
+ if (userID == null || accessToken == null || deviceID == null) {
+ throw new RuntimeException(
+ "Unable to query blob service due to missing CSAT.");
+ }
String authObjectJsonBody = new JSONObject()
.put("userID", userID)
diff --git a/native/ios/Comm/CommIOSServices/CommIOSBlobClient.mm b/native/ios/Comm/CommIOSServices/CommIOSBlobClient.mm
--- a/native/ios/Comm/CommIOSServices/CommIOSBlobClient.mm
+++ b/native/ios/Comm/CommIOSServices/CommIOSBlobClient.mm
@@ -251,18 +251,26 @@
auto userID = comm::CommSecureStore::get(comm::CommSecureStore::userID);
auto deviceID = comm::CommSecureStore::get(comm::CommSecureStore::deviceID);
- NSString *userIDObjC = userID.hasValue()
- ? [NSString stringWithCString:userID.value().c_str()
- encoding:NSUTF8StringEncoding]
- : @"";
- NSString *accessTokenObjC = accessToken.hasValue()
- ? [NSString stringWithCString:accessToken.value().c_str()
- encoding:NSUTF8StringEncoding]
- : @"";
- NSString *deviceIDObjC = deviceID.hasValue()
- ? [NSString stringWithCString:deviceID.value().c_str()
- encoding:NSUTF8StringEncoding]
- : @"";
+ if (!userID.hasValue() || !accessToken.hasValue() || !deviceID.hasValue()) {
+ *error = [NSError
+ errorWithDomain:@"app.comm"
+ code:NSURLErrorUserAuthenticationRequired
+ userInfo:@{
+ NSLocalizedDescriptionKey :
+ @"Unable to query blob service due to missing CSAT."
+ }];
+ return nil;
+ }
+
+ NSString *userIDObjC = [NSString stringWithCString:userID.value().c_str()
+ encoding:NSUTF8StringEncoding];
+
+ NSString *accessTokenObjC =
+ [NSString stringWithCString:accessToken.value().c_str()
+ encoding:NSUTF8StringEncoding];
+
+ NSString *deviceIDObjC = [NSString stringWithCString:deviceID.value().c_str()
+ encoding:NSUTF8StringEncoding];
NSDictionary *jsonAuthObject = @{
@"userID" : userIDObjC,
diff --git a/web/cpp/SQLiteQueryExecutorBindings.cpp b/web/cpp/SQLiteQueryExecutorBindings.cpp
--- a/web/cpp/SQLiteQueryExecutorBindings.cpp
+++ b/web/cpp/SQLiteQueryExecutorBindings.cpp
@@ -248,11 +248,18 @@
.function("removeEntries", &SQLiteQueryExecutor::removeEntries)
.function("removeAllEntries", &SQLiteQueryExecutor::removeAllEntries)
.function("getAllEntries", &SQLiteQueryExecutor::getAllEntries)
- .function("replaceMessageStoreLocalMessageInfo", &SQLiteQueryExecutor::replaceMessageStoreLocalMessageInfo)
- .function("removeMessageStoreLocalMessageInfos", &SQLiteQueryExecutor::removeMessageStoreLocalMessageInfos)
.function(
- "removeAllMessageStoreLocalMessageInfos", &SQLiteQueryExecutor::removeAllMessageStoreLocalMessageInfos)
- .function("getAllMessageStoreLocalMessageInfos", &SQLiteQueryExecutor::getAllMessageStoreLocalMessageInfos)
+ "replaceMessageStoreLocalMessageInfo",
+ &SQLiteQueryExecutor::replaceMessageStoreLocalMessageInfo)
+ .function(
+ "removeMessageStoreLocalMessageInfos",
+ &SQLiteQueryExecutor::removeMessageStoreLocalMessageInfos)
+ .function(
+ "removeAllMessageStoreLocalMessageInfos",
+ &SQLiteQueryExecutor::removeAllMessageStoreLocalMessageInfos)
+ .function(
+ "getAllMessageStoreLocalMessageInfos",
+ &SQLiteQueryExecutor::getAllMessageStoreLocalMessageInfos)
.function("beginTransaction", &SQLiteQueryExecutor::beginTransaction)
.function("commitTransaction", &SQLiteQueryExecutor::commitTransaction)
.function(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 29, 2:30 PM (22 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2201059
Default Alt Text
D12552.diff (4 KB)
Attached To
Mode
D12552: Refrain from querying blob service from the NSE if CAST is missing
Attached
Detach File
Event Timeline
Log In to Comment