Skip to content

Commit

Permalink
Merge pull request #456 from rudderlabs/release/1.23.3
Browse files Browse the repository at this point in the history
chore(release): pulling release/1.23.3 into master
  • Loading branch information
1abhishekpandey committed Jul 1, 2024
2 parents aecdae4 + 2ad1df6 commit 00fd484
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.23.3](https://github.com/rudderlabs/rudder-sdk-android/compare/v1.23.2...v1.23.3) (2024-07-01)


### Bug Fixes

* handle CursorWindowAllocationException ([#454](https://github.com/rudderlabs/rudder-sdk-android/issues/454)) ([5ddc570](https://github.com/rudderlabs/rudder-sdk-android/commit/5ddc57054029c5d5a80ee33be0e163928abe95b2))

### [1.23.2](https://github.com/rudderlabs/rudder-sdk-android/compare/v1.23.1...v1.23.2) (2024-06-25)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ int getDeviceModeWithProcessedPendingEventsRecordCount() {
private int getCountForCommand(String sql) {
// initiate count
int count = -1;

Cursor cursor = null;
try {
// get readable database instance
if (!persistence.isAccessible()) {
Expand All @@ -419,7 +419,6 @@ private int getCountForCommand(String sql) {
}

RudderLogger.logDebug(String.format(Locale.US, "DBPersistentManager: getDBRecordCount: countSQL: %s", sql));
Cursor cursor;
synchronized (DB_LOCK) {
cursor = persistence.rawQuery(sql, null);
}
Expand All @@ -433,12 +432,14 @@ private int getCountForCommand(String sql) {
} else {
RudderLogger.logInfo("DBPersistentManager: getDBRecordCount: DB is empty");
}
// release cursor
cursor.close();

} catch (SQLiteDatabaseCorruptException ex) {
RudderLogger.logError(ex);
ReportManager.reportError(ex);
} finally {
if (cursor != null) {
// release cursor
cursor.close();
}
}

return count;
Expand Down Expand Up @@ -510,6 +511,7 @@ private void acquireSemaphore() {
Thread.currentThread().interrupt();
}
}

private void waitTillMigrationsAreDone() {
if(migrationSemaphore.availablePermits() == 1 ){
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.rudderstack.android.sdk.core.util.MessageUploadLock;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -119,8 +120,16 @@ private void deleteEventsWithoutAnonymousId(ArrayList<String> messages, ArrayLis
* check if the number of events in the db crossed the dbCountThreshold then delete the older events which are in excess.
*/
private void maintainDBThreshold() {
// get current record count from db
int recordCount = dbManager.getDBRecordCount();
int recordCount = 0;
try {
// get current record count from db
recordCount = dbManager.getDBRecordCount();
}
// Added RuntimeException in order to catch CursorWindowAllocationException (this requires API level 33 and above).
catch (RuntimeException ex) {
RudderLogger.logError("CloudModeManager: maintainDBThreshold: Exception while fetching count from DB due to: " + Arrays.toString(ex.getStackTrace()));
ReportManager.reportError(ex);
}
RudderLogger.logDebug(String.format(Locale.US, "CloudModeManager: getPayloadFromMessages: DBRecordCount: %d", recordCount));
// if record count exceeds threshold count, remove older events
if (recordCount > config.getDbCountThreshold()) {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android.enableJetifier=true
android.enableR8.fullMode=true
kotlin.code.style=official
GROUP=com.rudderstack.android.sdk
VERSION_CODE=29
VERSION_NAME=1.23.2
VERSION_CODE=30
VERSION_NAME=1.23.3
POM_NAME=Rudderstack SDK for android
POM_DESCRIPTION=Rudderstack SDK for android
POM_ARTIFACT_ID=core
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.23.2",
"version": "1.23.3",
"dependencies": {
"properties-reader": "^2.2.0"
}
Expand Down

0 comments on commit 00fd484

Please sign in to comment.