You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Implement Firebase segmentation SDK device local cache
* [Firebase Segmentation] Add custom installation id cache layer and tests for it.
* Add test for updating cache
* Switch to use SQLiteOpenHelper
* Switch to use SharedPreferences from SQLite.
* Change the cache class to be singleton
* Wrap shared pref commit in a async task.
* Address comments
* Google format fix
* Replace some deprecated code.
* Package refactor
* nit
* nit
* Add the state machine of updating custom installation id in the local
cache and update to Firebase Segmentation backend. CL also contains unit
tests.
(The http client is not implemented yet.)
* minor format fix
* Address comments #1
* Http client in Firebase Segmentation SDK to call backend service.
* Revert unintentional change
* Fix connected device test
* Fix connected device test
* 1. Add a few annotations to make java code Kotlin friendly
2. Some fixes for the http request format
* Fix java format
* Fix API version
* Change the segmentation API implementation to synchronous and put the
entire synchronous code block in async task.
* Fix a async getResult race issue.
* OkHttpClient -> HttpsUrlConnection
* Use gzip for compressing content and fix ourput stream memory leak risk.
* Addressed a few comments
* FirebaseSegmentation SDK
1. Clean up http client response code.
2. When updateCustomInstallationId is called, on non-retryable server errors, the SDK should clean up the local cache. Instead, for retryable errors, SDK can keep the local cache for retrying update later.
Copy file name to clipboardExpand all lines: firebase-segmentation/src/androidTest/java/com/google/firebase/segmentation/FirebaseSegmentationInstrumentedTest.java
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,8 @@ public void testUpdateCustomInstallationId_CacheOk_BackendOk() throws Exception
Copy file name to clipboardExpand all lines: firebase-segmentation/src/main/java/com/google/firebase/segmentation/SetCustomInstallationIdException.java
Copy file name to clipboardExpand all lines: firebase-segmentation/src/main/java/com/google/firebase/segmentation/remote/SegmentationServiceClient.java
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -41,15 +41,15 @@ public class SegmentationServiceClient {
41
41
publicenumCode {
42
42
OK,
43
43
44
-
HTTP_CLIENT_ERROR,
45
-
46
44
CONFLICT,
47
45
46
+
UNAUTHORIZED,
47
+
48
48
NETWORK_ERROR,
49
49
50
-
SERVER_ERROR,
50
+
HTTP_CLIENT_ERROR,
51
51
52
-
UNAUTHORIZED,
52
+
SERVER_ERROR,
53
53
}
54
54
55
55
@NonNull
@@ -100,6 +100,9 @@ public Code updateCustomInstallationId(
100
100
case409:
101
101
returnCode.CONFLICT;
102
102
default:
103
+
if (httpResponseCode / 100 == 4) {
104
+
returnCode.HTTP_CLIENT_ERROR;
105
+
}
103
106
returnCode.SERVER_ERROR;
104
107
}
105
108
} catch (IOExceptione) {
@@ -158,6 +161,9 @@ public Code clearCustomInstallationId(
0 commit comments