Skip to content
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

Null issue fixed : Introduced in v3.12.3 #42

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG


## Version 3.12.4

### Date: 10-Oct-2023

- Fixed Context Issue introduced in v3.12.3

---

## Version 3.12.0

### Date: 02-May-2023
Expand Down
12 changes: 6 additions & 6 deletions contentstack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ android {
signingConfig signingConfigs.debug
}
buildTypes {
//def localProperties = new Properties()
//localProperties.load(new FileInputStream(rootProject.file("local.properties")))
def localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

testOptions {
Expand All @@ -44,6 +44,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void onCompletion(ResponseType responseType, Error error) {
assertEquals("phoenix2.jpg", asset.getFileName());
assertEquals("482141", asset.getFileSize());
} else {
assertEquals(0, error.getErrorCode());
assertEquals(105, error.getErrorCode());
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public static void oneTimeSetUp() throws Exception {
}



@Test
public void test_01_fetchAllEntries() {
query.find(new QueryResultsCallBack() {
Expand Down Expand Up @@ -615,7 +614,6 @@ public void onCompletion(ResponseType responseType, QueryResult queryresult, Err

@Test
public void test_41_entry_include_embedded_items_unit_test() throws Exception {

final Query query = TestCred.stack().contentType("user").query();
query.includeEmbeddedItems().find(new QueryResultsCallBack() {
@Override
Expand Down
20 changes: 0 additions & 20 deletions contentstack/src/azure-eu/java/AzureEUTest.java

This file was deleted.

20 changes: 0 additions & 20 deletions contentstack/src/azure-na/java/AzureNATest.java

This file was deleted.

20 changes: 0 additions & 20 deletions contentstack/src/eu/java/EUInstrumentedTest.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ public void send() {
headers.put("User-Agent", defaultUserAgent());
headers.put("X-User-Agent", "contentstack-android/" + SDKConstant.SDK_VERSION);
jsonObjectRequest = new JSONUTF8Request(requestId, url, requestJSON, response -> {
responseJSON = response;
if (responseJSON != null) {
this.responseJSON = response;
if (this.responseJSON != null) {
connectionRequest.onRequestFinished(CSHttpConnection.this);
}
}, this::generateBuiltError) {
Expand Down
14 changes: 8 additions & 6 deletions contentstack/src/main/java/com/contentstack/sdk/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ public void setBranch(String branch) {
* <b>Note:</b> Default region sets to us </a>
*
* <br><br><b>Example For Different Regions:</b><br>
* <pre class="prettyprint">
* config.setRegion(ContentstackRegion.US);
* config.setRegion(ContentstackRegion.EU);
* config.setRegion(ContentstackRegion.AZURE_EU);
* config.setRegion(ContentstackRegion.AZURE_NA);
* </pre>
* <pre>
* {@code
* config.setRegion(ContentstackRegion.US);
* config.setRegion(ContentstackRegion.EU);
* config.setRegion(ContentstackRegion.AZURE_EU);
* config.setRegion(ContentstackRegion.AZURE_NA);
* }
* </pre>
*/
public ContentstackRegion setRegion(ContentstackRegion region) {
this.region = region;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static Stack stack(@NotNull Context context, @NotNull String apiKey, @Not
if (!TextUtils.isEmpty(apiKey) || !TextUtils.isEmpty(deliveryToken) || !TextUtils.isEmpty(environment)) {
Config config = new Config();
config.setEnvironment(environment);
ctx = context;
return initializeStack(context, apiKey, deliveryToken, config);
} else {
throw new Exception(SDKConstant.EMPTY_CREDENTIALS_NOT_ALLOWED);
Expand All @@ -71,6 +72,7 @@ public static Stack stack(@NotNull Context context, @NotNull String apiKey, @Not
public static Stack stack(@NotNull Context context, @NotNull String apiKey, @NotNull String deliveryToken, @NotNull String environment, @NotNull Config config) throws Exception {
if (!TextUtils.isEmpty(apiKey) || !TextUtils.isEmpty(deliveryToken) || !TextUtils.isEmpty(environment)) {
config.setEnvironment(environment);
ctx = context;
return initializeStack(context, apiKey, deliveryToken, config);
} else {
throw new Exception(SDKConstant.EMPTY_CREDENTIALS_NOT_ALLOWED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class SDKConstant {
public static final boolean debug = false;
public static boolean IS_NETWORK_AVAILABLE = true;
public static String PROTOCOL = "https://";
public static String SDK_VERSION = "3.12.1";
public static String SDK_VERSION = "3.12.4";
public final static int NO_NETWORK_CONNECTION = 408;
public final static int TimeOutDuration = 30000; // timeout in millisecond
public final static int NumRetry = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ public void onCompletion(SyncStack syncStack, Error error) {
});
} catch (Exception e) {
Error error = new Error();
error.setErrorMessage(SDKConstant.PLEASE_PROVIDE_VALID_JSON);
error.setErrorMessage(e.getLocalizedMessage());
callback.onRequestFail(ResponseType.UNKNOWN, error);
}
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/publish-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'signing'
ext {
PUBLISH_GROUP_ID = 'com.contentstack.sdk'
PUBLISH_ARTIFACT_ID = 'android'
PUBLISH_VERSION = '3.12.1'
PUBLISH_VERSION = '3.12.4-SNAPSHOT'
POM_NAME = 'contentstack-android'
WEBSITE = 'http://www.contentstack.com'
PUBLISH_DESCRIPTION = 'The Content Delivery SDK is used to retrieve content from your Contentstack account and deliver it to your web or mobile properties.'
Expand Down Expand Up @@ -37,7 +37,7 @@ artifacts {
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
aar(MavenPublication) {
groupId = PUBLISH_GROUP_ID
artifactId = PUBLISH_ARTIFACT_ID
version = PUBLISH_VERSION
Expand Down
33 changes: 27 additions & 6 deletions scripts/publish-root.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,38 @@ if (secretPropsFile.exists()) {

nexusPublishing {
repositories {
// sonatype {
// stagingProfileId = sonatypeStagingProfileId
// username = ossrhUsername
// password = ossrhPassword
// nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
// snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
// if (project.version.endsWith('-SNAPSHOT')) {
// snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots"))
// } else {
// nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
// }
// }

// sonatype {
// stagingProfileId = sonatypeStagingProfileId
// username = ossrhUsername
// password = ossrhPassword
//
// if (project.version.endsWith('-SNAPSHOT')) {
// snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots"))
// } else {
// nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
// }
// }

sonatype {
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
//nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
if (project.version.endsWith('-SNAPSHOT')) {
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots"))
} else {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
}
}

}
}
Loading