Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@
#this is to match java checkstyle
max_line_length=120
ktlint_code_style=android_studio

# Disabled rules
ktlint_standard_class-signature = disabled # don't force parameters onto one line in constructors
ktlint_standard_value-parameter-comment = disabled # Allow same-line comments in parameters

# Disable ktlint on generated source code, see
# https://github.com/JLLeitschuh/ktlint-gradle/issues/746
[**/build/generated/**]
ktlint = disabled
1 change: 0 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [Release 2.27.3](https://github.com/aws-amplify/amplify-android/releases/tag/release_v2.27.3)

### Bug Fixes
- **storage:** Fix rare edge case of transfer status update crash ([#3006](https://github.com/aws-amplify/amplify-android/issues/3006))

[See all changes between 2.27.2 and 2.27.3](https://github.com/aws-amplify/amplify-android/compare/release_v2.27.2...release_v2.27.3)

## [Release 2.27.2](https://github.com/aws-amplify/amplify-android/releases/tag/release_v2.27.2)

### Bug Fixes
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ dependencies section:
```groovy
dependencies {
// Only specify modules that provide functionality your app will use
implementation 'com.amplifyframework:aws-analytics-pinpoint:2.27.2'
implementation 'com.amplifyframework:aws-api:2.27.2'
implementation 'com.amplifyframework:aws-auth-cognito:2.27.2'
implementation 'com.amplifyframework:aws-datastore:2.27.2'
implementation 'com.amplifyframework:aws-predictions:2.27.2'
implementation 'com.amplifyframework:aws-storage-s3:2.27.2'
implementation 'com.amplifyframework:aws-geo-location:2.27.2'
implementation 'com.amplifyframework:aws-push-notifications-pinpoint:2.27.2'
implementation 'com.amplifyframework:aws-analytics-pinpoint:2.27.3'
implementation 'com.amplifyframework:aws-api:2.27.3'
implementation 'com.amplifyframework:aws-auth-cognito:2.27.3'
implementation 'com.amplifyframework:aws-datastore:2.27.3'
implementation 'com.amplifyframework:aws-predictions:2.27.3'
implementation 'com.amplifyframework:aws-storage-s3:2.27.3'
implementation 'com.amplifyframework:aws-geo-location:2.27.3'
implementation 'com.amplifyframework:aws-push-notifications-pinpoint:2.27.3'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ package com.amplifyframework.annotations
@Suppress("DEPRECATION")
@RequiresOptIn(
level = RequiresOptIn.Level.ERROR,
message = "This API is internal to Amplify and should not be used. It could be removed or changed without notice.",
message = "This API is internal to Amplify and should not be used. It could be removed or changed without notice."
)
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.TYPEALIAS,
AnnotationTarget.FUNCTION,
AnnotationTarget.PROPERTY,
AnnotationTarget.FIELD,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.CONSTRUCTOR
)
public annotation class InternalAmplifyApi
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ package com.amplifyframework.annotations
@Suppress("DEPRECATION")
@RequiresOptIn(
level = RequiresOptIn.Level.WARNING,
message = "This API is internal to Amplify and should not be used. It could be removed or changed without notice.",
message = "This API is internal to Amplify and should not be used. It could be removed or changed without notice."
)
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.TYPEALIAS,
AnnotationTarget.FUNCTION,
AnnotationTarget.PROPERTY,
AnnotationTarget.FIELD,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.CONSTRUCTOR
)
public annotation class InternalApiWarning
10 changes: 10 additions & 0 deletions apollo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [Release 1.2.0](https://github.com/aws-amplify/amplify-android/releases/tag/release_apollo_v1.2.0)

### Features
- **Apollo:** Add constructor to ApolloAmplifyConnector for directly specifying connection information ([#2980](https://github.com/aws-amplify/amplify-android/issues/2980))

### Bug Fixes
- **apollo:** Fix using Apollo to connect to AppSync in China ([#2947](https://github.com/aws-amplify/amplify-android/issues/2947))

[See all changes between 1.1.0 and 1.2.0](https://github.com/aws-amplify/amplify-android/compare/release_apollo_v1.1.0...release_apollo_v1.2.0)

## [Release 1.1.0](https://github.com/aws-amplify/amplify-android/releases/tag/release_apollo_v1.1.0)

### Features
Expand Down
4 changes: 2 additions & 2 deletions apollo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Add the dependency you prefer to your `build.gradle.kts` file.

```kotlin
// To only use Apollo to speak to AppSync, without using Amplify
implementation("com.amplifyframework:apollo-appsync:1.1.0")
implementation("com.amplifyframework:apollo-appsync:1.2.0")

// To connect Apollo to AppSync using your existing Amplify Gen2 Backend
implementation("com.amplifyframework:apollo-appsync-amplify:1.1.0")
implementation("com.amplifyframework:apollo-appsync-amplify:1.2.0")
```

For applications using `apollo-appsync` directly, instantiate the Endpoint and the desired Authorizer instance, and then call the Apollo builder extension.
Expand Down
7 changes: 0 additions & 7 deletions apollo/apollo-appsync-amplify/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ group = properties["POM_GROUP"].toString()

android {
namespace = "com.amplifyframework.apollo.appsync"
defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
}
}

apollo {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@aws-amplify/backend": "^1.14.3",
"@aws-amplify/backend-cli": "^1.5.0",
"aws-cdk": "^2.1005.0",
"aws-cdk-lib": "^2.185.0",
"aws-cdk-lib": "^2.189.1",
"constructs": "^10.4.2",
"esbuild": "^0.25.1",
"tsx": "^4.19.3",
Expand Down
2 changes: 1 addition & 1 deletion apollo/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION_NAME=1.1.0
VERSION_NAME=1.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
*/
package com.amazonaws.sdk.appsync.amplify.authorizers

import com.amazonaws.sdk.appsync.amplify.util.AppSyncRequestSigner
import com.amazonaws.sdk.appsync.core.AppSyncAuthorizer
import com.amazonaws.sdk.appsync.core.AppSyncRequest
import com.amazonaws.sdk.appsync.amplify.util.AppSyncRequestSigner
import com.amazonaws.sdk.appsync.core.authorizers.IamAuthorizer
import org.jetbrains.annotations.VisibleForTesting

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
*/
package com.amazonaws.sdk.appsync.amplify.authorizers

import com.amplifyframework.auth.AuthCredentialsProvider
import com.amplifyframework.auth.CognitoCredentialsProvider
import com.amazonaws.sdk.appsync.core.AppSyncAuthorizer
import com.amazonaws.sdk.appsync.core.AppSyncRequest
import com.amazonaws.sdk.appsync.core.authorizers.AuthTokenAuthorizer
import com.amplifyframework.auth.AuthCredentialsProvider
import com.amplifyframework.auth.CognitoCredentialsProvider
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import aws.smithy.kotlin.runtime.http.HttpBody
import aws.smithy.kotlin.runtime.http.request.HttpRequest
import aws.smithy.kotlin.runtime.http.toHttpBody
import aws.smithy.kotlin.runtime.net.url.Url
import com.amazonaws.sdk.appsync.core.AppSyncRequest
import com.amplifyframework.auth.AuthCredentialsProvider
import com.amplifyframework.auth.CognitoCredentialsProvider
import com.amazonaws.sdk.appsync.core.AppSyncRequest

internal class AppSyncRequestSigner(
private val credentialsProvider: AuthCredentialsProvider = CognitoCredentialsProvider(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
package com.amazonaws.sdk.appsync.amplify.authorizers

import com.amazonaws.sdk.appsync.core.AppSyncRequest
import com.amazonaws.sdk.appsync.amplify.util.AppSyncRequestSigner
import com.amazonaws.sdk.appsync.core.AppSyncRequest
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.matchers.maps.shouldContainExactly
import io.mockk.coEvery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import aws.smithy.kotlin.runtime.http.Headers
import aws.smithy.kotlin.runtime.http.HttpMethod
import aws.smithy.kotlin.runtime.http.request.HttpRequest
import aws.smithy.kotlin.runtime.http.toHttpBody
import com.amplifyframework.auth.AuthCredentialsProvider
import com.amazonaws.sdk.appsync.core.AppSyncRequest
import com.amplifyframework.auth.AuthCredentialsProvider
import io.kotest.matchers.equals.shouldBeEqual
import io.kotest.matchers.maps.shouldContain
import io.mockk.CapturingSlot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.onCompletion
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.withContext
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonArray
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonPrimitive
Expand All @@ -49,8 +48,7 @@ import kotlinx.serialization.json.JsonPrimitive
class EventsChannel internal constructor(
val name: String,
val authorizers: ChannelAuthorizers,
private val eventsWebSocketProvider: EventsWebSocketProvider,
private val json: Json
private val eventsWebSocketProvider: EventsWebSocketProvider
) {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ internal class EventsWebSocket(

override fun onMessage(webSocket: WebSocket, text: String) {
connectionTimeoutTimer.resetTimeoutTimer()
logger?.debug { "Websocket onMessage: $text" }
logger?.debug("Websocket onMessage received")
try {
val eventMessage = json.decodeFromString<WebSocketMessage.Received>(text)
emitEvent(eventMessage)
Expand Down Expand Up @@ -201,7 +201,7 @@ internal class EventsWebSocket(

// returns true if websocket queued up event. false if failed
private fun send(eventJson: String): Boolean {
logger?.debug { "send: $eventJson" }
logger?.debug("sending event over websocket")
return webSocket.send(eventJson)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package com.amazonaws.sdk.appsync.events

import com.amazonaws.sdk.appsync.core.AppSyncRequest
import io.kotest.matchers.shouldBe
import org.junit.Test
import okhttp3.Request
import org.junit.Test

class EventsWebSocketTest {
private lateinit var eventsEndpoints: EventsEndpoints
Expand All @@ -36,10 +36,9 @@ class EventsWebSocketTest {

val connectRequest = ConnectAppSyncRequest(eventsEndpoints, request)

connectRequest.method shouldBe AppSyncRequest.HttpMethod.POST
connectRequest.method shouldBe AppSyncRequest.HttpMethod.POST
connectRequest.body shouldBe "{}"
connectRequest.headers shouldBe mapOf("key" to "value")
connectRequest.url shouldBe eventsEndpoints.websocketBaseEndpoint.toString()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class PinpointAnalyticsCanaryTest {
@JvmStatic
fun setupBefore() {
val context = ApplicationProvider.getApplicationContext<Context>()

@RawRes val resourceId = Resources.getRawResourceId(context, CONFIGURATION_NAME)
appId = readAppIdFromResource(context, resourceId)
preferences = context.getSharedPreferences(
Expand Down Expand Up @@ -117,6 +118,7 @@ class PinpointAnalyticsCanaryTest {
@Before
fun flushEvents() {
val context = ApplicationProvider.getApplicationContext<Context>()

@RawRes val resourceId = Resources.getRawResourceId(context, CREDENTIALS_RESOURCE_NAME)
val userAndPasswordPair = readCredentialsFromResource(context, resourceId)
synchronousAuth.signOut()
Expand Down
Loading