Skip to content

Commit

Permalink
Merge pull request #1741 from microsoft/develop
Browse files Browse the repository at this point in the history
Version 5.0.5 additional changes
  • Loading branch information
DordeDimitrijev authored Sep 16, 2024
2 parents b498278 + e9be075 commit 2b02784
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
27 changes: 15 additions & 12 deletions .azurepipelines/publish-maven-1ES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ extends:
sdl:
sourceAnalysisPool: 1ES-PT-Windows-2022
stages:
- stage: stage
- stage: BuildArtifacts
displayName: Build Artifacts and collect version info
jobs:
- job: Phase_1
displayName: MacOS
- job: BuildArtifacts
displayName: Build Artifacts
cancelTimeoutInMinutes: 1
templateContext:
sdl:
codeql:
language: java, python, ruby
outputs:
- output: pipelineArtifact
displayName: 'Publish Artifact: Release'
Expand Down Expand Up @@ -71,17 +75,16 @@ extends:
inputs:
tasks: publish
publishJUnitResults: false
- task: SFP.release-tasks.custom-build-release-task.EsrpRelease@4
displayName: ESRP Release
- task: Bash@3
displayName: 'Extract Version info'
inputs:
ConnectedServiceName: ESRP Release
FolderLocation: $(Build.ArtifactStagingDirectory)/com/microsoft
Owners: lucen@microsoft.com
Approvers: lucen@microsoft.com
enabled: true

targetType: 'inline'
script: |
VERSION=$(grep "versionName = '" versions.gradle | awk -F "[']" '{print $2}')
echo $VERSION > $(Build.ArtifactStagingDirectory)/com/microsoft/version
- stage: APIScan
dependsOn: Stage
dependsOn: BuildArtifacts
pool:
name: 1ES-PT-Windows-2022
os: windows
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### AppCenter

* **[Fix]** Fix closing cursor after deleting old records.
* **[Improvement]** Use java.security.Random instead of java.util.Random.

### App Center Crashes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,14 @@ public ContentValues deleteTheOldestRecord(@NonNull Set<String> columnsToReturn,
SQLiteQueryBuilder queryBuilder = SQLiteUtils.newSQLiteQueryBuilder();
queryBuilder.appendWhere(priorityColumn + " <= ?");
columnsToReturn.add(PRIMARY_KEY);
Cursor cursor = getCursor(queryBuilder, columnsToReturn.toArray(new String[0]), new String[]{String.valueOf(priority)}, priorityColumn + " , " + PRIMARY_KEY);
ContentValues rowData = nextValues(cursor);
if (rowData != null) {
long deletedId = rowData.getAsLong(PRIMARY_KEY);
delete(deletedId);
AppCenterLog.debug(LOG_TAG, "Deleted log id=" + deletedId);
return rowData;
try (Cursor cursor = getCursor(queryBuilder, columnsToReturn.toArray(new String[0]), new String[]{String.valueOf(priority)}, priorityColumn + " , " + PRIMARY_KEY)) {
ContentValues rowData = nextValues(cursor);
if (rowData != null) {
long deletedId = rowData.getAsLong(PRIMARY_KEY);
delete(deletedId);
AppCenterLog.debug(LOG_TAG, "Deleted log id=" + deletedId);
return rowData;
}
}
AppCenterLog.error(LOG_TAG, String.format("Failed to delete the oldest log from database %s.", mDatabase));
return null;
Expand Down

0 comments on commit 2b02784

Please sign in to comment.