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

catch exceptions from processOutboxItem #1743

Merged
merged 5 commits into from
Jun 28, 2022

Conversation

joekiller
Copy link
Contributor

@joekiller joekiller commented May 20, 2022

processOutBoxItem should be wrapped to catch exceptions from the method as the blocking await only catches the timeout and returns false. otherwise the exception ends up uncaught

https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling

Issue #, if available:
N/A

Description of changes:
Catch pending mutation exceptions while draining the outbox.

How did you test these changes?
(Please add a line here how the changes were tested)

  • Added Unit Tests
  • Tested on frontend (Add Screenshots)
  • Successful logs (Attach them to the PR)

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

processOutBoxItem should be wrapped to catch exceptions from the method as the blocking await only catches the timeout and returns false

https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling
@joekiller joekiller requested a review from a team as a code owner May 20, 2022 14:45
@joekiller
Copy link
Contributor Author

joekiller commented May 21, 2022

This fixes errors such as where drainMutationOutbox is interrupted outside of the blockingAwait which results in an uncaught exception.

To create the exception. Start a thread that continues to create a series of create objects. Run the test with the system hooked up to an api online. Transition to offline while it runs and let records accumulate. Turn the network back on and let the mutations drain. Once they are draining, remove the network which causes an interrupt on the wire vs the blockingAwait.

2022-05-21 08:39:22.470 9389-10284/? E/AndroidRuntime: FATAL EXCEPTION: RxSingleScheduler-1
    java.lang.RuntimeException: java.lang.InterruptedException
        at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
        at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingAwait(BlockingMultiObserver.java:140)
        at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1490)
        at com.amplifyframework.datastore.syncengine.MutationProcessor.drainMutationOutbox(MutationProcessor.java:117)
        at com.amplifyframework.datastore.syncengine.MutationProcessor.lambda$startDrainingMutationOutbox$1$MutationProcessor(MutationProcessor.java:101)
        at com.amplifyframework.datastore.syncengine.MutationProcessor$$ExternalSyntheticLambda3.apply(Unknown Source:4)
        at io.reactivex.rxjava3.internal.operators.observable.ObservableFlatMapCompletableCompletable$FlatMapCompletableMainObserver.onNext(ObservableFlatMapCompletableCompletable.java:97)
        at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
        at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
        at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
        at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1065)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1358)
        at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
        at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingAwait(BlockingMultiObserver.java:134)
        at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1490) 
        at com.amplifyframework.datastore.syncengine.MutationProcessor.drainMutationOutbox(MutationProcessor.java:117) 
        at com.amplifyframework.datastore.syncengine.MutationProcessor.lambda$startDrainingMutationOutbox$1$MutationProcessor(MutationProcessor.java:101) 
        at com.amplifyframework.datastore.syncengine.MutationProcessor$$ExternalSyntheticLambda3.apply(Unknown Source:4) 
        at io.reactivex.rxjava3.internal.operators.observable.ObservableFlatMapCompletableCompletable$FlatMapCompletableMainObserver.onNext(ObservableFlatMapCompletableCompletable.java:97) 
        at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201) 
        at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255) 
        at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65) 
        at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:919) 

@joekiller
Copy link
Contributor Author

joekiller commented May 21, 2022

To work around this I have to use the generic RxJavaPlugins.setErrorHandler instead of just using my datastore error handler.

RxJavaPlugins.setErrorHandler(e -> {
            Throwable throwable = (Throwable) e;
            Log.e("ErrorCatcher", "Kaboom", throwable)
            if (throwable instanceof UndeliverableException) {
                throwable = throwable.getCause();
            }
            if (throwable instanceof RuntimeException)
                // this is where the interrupt is usually wrapped
            {
                throwable = throwable.getCause();
            }
            if ((throwable instanceof IOException) || (throwable instanceof SocketException)) {
                // fine, irrelevant network problem or API that throws on cancellation
                return;
            }
            if (throwable instanceof InterruptedException) {
                // fine, some blocking code was interrupted by a dispose call
                return;
            }

});

@joekiller
Copy link
Contributor Author

Example log when fixed:

05-20 09:17:12.291  2832  3582 I System.out: E: > Datastore Error Catcher
05-20 09:17:12.292  2832  3582 I System.out: E: > Failure performing sync query to AppSync.
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: Initial sync during DataStore initialization failed.
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: java.lang.RuntimeException: DataStoreException{message=Failure performing sync query to AppSync., cause=ApiException{message=OkHttp client request failed., cause=java.net.SocketTimeoutException: timeout, recoverySuggestion=See attached exception for more details.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:94)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.core.Completable.blockingAwait(Completable.java:1461)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$3$Orchestrator(Orchestrator.java:307)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at com.amplifyframework.datastore.syncengine.-$$Lambda$Orchestrator$to6jsrpqq5TGk-8kfWyEK_7WfwQ.subscribe(Unknown Source:2)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at java.lang.Thread.run(Thread.java:919)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: Caused by: DataStoreException{message=Failure performing sync query to AppSync., cause=ApiException{message=OkHttp client request failed., cause=java.net.SocketTimeoutException: timeout, recoverySuggestion=See attached exception for more details.}, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$sync$1(AppSyncClient.java:124)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at com.amplifyframework.datastore.appsync.-$$Lambda$AppSyncClient$suvEma05s-p8v-66iE4cswLKYac.accept(Unknown Source:4)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at com.amplifyframework.api.aws.AppSyncGraphQLOperation$OkHttpCallback.onFailure(AppSyncGraphQLOperation.java:161)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:525)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	... 3 more
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: Caused by: ApiException{message=OkHttp client request failed., cause=java.net.SocketTimeoutException: timeout, recoverySuggestion=See attached exception for more details.}
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	... 5 more
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: Caused by: java.net.SocketTimeoutException: timeout
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:677)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:686)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.kt:143)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.kt:96)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at com.amplifyframework.api.aws.UserAgentInterceptor.intercept(UserAgentInterceptor.java:56)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
05-20 09:17:12.293  2832  4967 W amplify:aws-datastore: 	... 3 more
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: Error ended observation of mutation outbox: 
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: DataStoreException{message=Timeout processing PendingMutation{REDACTED}, cause=null, recoverySuggestion=Check your internet connection.}
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at com.amplifyframework.datastore.syncengine.MutationProcessor.drainMutationOutbox(MutationProcessor.java:120)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at com.amplifyframework.datastore.syncengine.MutationProcessor.lambda$startDrainingMutationOutbox$1$MutationProcessor(MutationProcessor.java:101)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at com.amplifyframework.datastore.syncengine.-$$Lambda$MutationProcessor$bjecRv6fl8W6Pcgjld1zB2NDYX8.apply(Unknown Source:4)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.operators.observable.ObservableFlatMapCompletableCompletable$FlatMapCompletableMainObserver.onNext(ObservableFlatMapCompletableCompletable.java:97)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
05-20 09:17:12.501  2832  3359 W amplify:aws-datastore: 	at java.lang.Thread.run(Thread.java:919)
05-20 09:17:12.502  2832  3359 I amplify:aws-datastore: Started processing the mutation outbox. Pending mutations will be published to the cloud.

@mikepschneider
Copy link
Contributor

Thank you for your submission. We are reviewing the changes. Did you try adding unit tests for this?

@joekiller
Copy link
Contributor Author

Hello, I can reply to both of your replies but I think the answer is the same on both sides. I considered adding unit tests however it was unclear how I would do it in an expeditious way as I only was able to identify a way to continuously cause the problem while using the software as it was and then worked to solve it.

For this particular fix it is somewhat obvious in hindsight that the code as it exists failed to handle the checked RuntimeException that will be thrown during an InterruptedException as indicated in the blockingAwait documentation. As I googled to explain why this checked exception was uncaught by the .subscribe, which I assume most would wonder, I found a good article about Error Handling in RXjava that pointed out that .subscribe only handles unchecked exceptions and does not handle checked exceptions. which in this case is the Runtime Exception, as indicated by the docs, needs to be caught somewhere which is exactly what my PR does.

If you have a suggestion or could point to some example code that could help make the RuntimeException pop out of processOutboxItem I would consider adding it, however I hope that it is obvious now that the checked exception needs to be handled and that is what this code is doing.

@mikepschneider mikepschneider requested a review from a team as a code owner June 27, 2022 23:01
"Timeout processing " + next, "Check your internet connection."
));
}
} catch (RuntimeException error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we additionally catch the base exception? catch(Exception e)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the blockingAwait docs, mentioned earlier, the only other checked exception that would pop out is a NullPointerException which may be diligent to add, although I've never witnessed it.

Otherwise all unchecked exceptions should get picked up by https://github.com/aws-amplify/amplify-android/pull/1743/files#diff-ca60e5fcab67ffd6928cc6cc642368d11198d4567f37905a1d2505b6b31547a8R104

@mikepschneider mikepschneider enabled auto-merge (squash) June 28, 2022 16:11
@mikepschneider mikepschneider merged commit 6a5d750 into aws-amplify:main Jun 28, 2022
@joekiller joekiller deleted the wrap-runtime-exception branch June 28, 2022 17:36
@mikepschneider
Copy link
Contributor

Thanks for this submission. These fixes should go out in the Thursday release.

@joekiller
Copy link
Contributor Author

Happy to help. Thanks for the attention.

div5yesh added a commit that referenced this pull request Aug 25, 2022
* Send snapshot on updates which render an item in list to not qualify a predicate.

* Revert "Send snapshot on updates which render an item in list to not qualify a predicate."

This reverts commit 4665a7b

* Adding create composite primary key on sqllite table (#1590)

* Adding create composite primary key on sqllite table

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/SQLiteCommandFactory.java

typo

Co-authored-by: Thomas Leing <bluezebragames@gmail.com>

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/SQLiteCommandFactory.java

Co-authored-by: Thomas Leing <bluezebragames@gmail.com>

Co-authored-by: Thomas Leing <bluezebragames@gmail.com>

* Adding support for custom primary key across the codebase.

* Adding support for custom primary key across the codebase.

* Added default implementation for resolveIdentifier in Model interface, to make it backwards compatible.

* Added default implementation for resolveIdentifier in Model interface, to make it backwards compatible.

* Added default implementation for resolveIdentifier in Model interface, to make it backwards compatible.

* Work in progress Custom primary key in storage engine.

* Work in progress Custom primary key in storage engine.

* test fixes and check style.

* Adding custom primary key support to SerializedModel.

* Updating selection set of leaf element to get primary key fields from the schema.

* Added __typename to appsync selection set so the type can be computed for flutter serialized models.

* Fixed integration test.

* Fixed sql index on undefined index not getting created.

* Fixed sql index on undefined index not getting created.

* Reverting not needed change.

* Clean up and updated concatenation logic for primary key.

* Making SerializedModel resolve identifier return Serializable.

* Checkstyle fixes.

* Updated concatenation code for model primary key.

* Test fix.

* Test fix.

* Test fix.

* Test fix.

* Test fix.

* Optimization to make @@primary key only in case of composite primary key.

* Clean up

* Increasing timeout for flaky test.

* Ignoring the test failing in the build.

* Increasing timeout on AWSDatastore plugin for tests.

* Updating where.identifier method.

* Increasing timeout for slow running test.

* Update testmodels/src/main/java/com/amplifyframework/testmodels/personcar/PersonWithCPK.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update aws-api-appsync/src/main/java/com/amplifyframework/datastore/appsync/ModelMetadata.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update aws-api-appsync/src/main/java/com/amplifyframework/datastore/appsync/ModelMetadata.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update aws-api-appsync/src/main/java/com/amplifyframework/datastore/appsync/ModelMetadata.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Code review suggestions.

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/adapter/SQLiteColumn.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update core/src/main/java/com/amplifyframework/core/model/ModelPrimaryKey.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update aws-datastore/src/androidTest/java/com/amplifyframework/datastore/BasicCloudSyncInstrumentationTest.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Code review suggestions.

* Increasing time out for orchestrator semaphore

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/SqlQueryProcessor.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Formatting fixes.

* PR suggestions.

* Update core/src/main/java/com/amplifyframework/core/model/ModelPrimaryKey.java

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* Update core/src/main/java/com/amplifyframework/core/model/ModelPrimaryKey.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Deprecating where.id method.

* Checkstyle

* where.id deprecation in datastore integration tests.

* Code optimization to create SQL index for primary key fields only if it is a composite.

* Fixed flaky test.

* Added an integration test for a flaky unit test.

* fix(datastore): #1584 When DateTimeParseException is not available for lower apis (#1701)

* Removed dataTimeParseException class as it is not available in api < 25

* Fixed the failing temporaldatetimetest

Co-authored-by: Divyesh Chitroda <div5yesh@gmail.com>

* Refactored the code around sync expression predicate of QueryPredicates.all and QueryPredicates.none().

* Checkstyle

* Removing integration test for custom primary untill I find a way to fix the environment.

* Version bumps (#1721)

* Version bumps

* Empty commit to bump codebuild

Co-authored-by: Thomas Leing <leint@amazon.com>

* chore: add geo to bug and feature report templates (#1722)

* Accidental change.

* Indentations.

* Update changelog after manual release v1.35.3 (#1724)

* Update changelog after manual release v1.35.3

* Update core-kotlin changelog as well

Co-authored-by: Thomas Leing <leint@amazon.com>

* Fixing get unique key function on Model primary key helper.

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/adapter/SQLiteTable.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Fixing cascade delete on a child with custom primary key. (#1731)

Added support for cascade delete of a child object with custom primary key.

* chore: Update CODEOWNERS [skip ci] (#1733)

Update CODEOWNERS file to use new team structure

* Updated schema version of
testmodels/src/main/java/com/amplifyframework/testmodels/commentsblog/schema.graphql to the
latest version.

Also modified the schema to have a custom primary key with a foreign key relationship.   This
caused the schema to change so all of the tests that depended on that schema had to be updated
also.

 # Please enter the commit message for your changes. Lines starting

* Modifying create mutation to handle custom foreign keys.

* Updating Create mutation to work with custom foreign keys.

* chore: notify comments on closed issues (#1739)

* Update notify_comments.yml

* update comments

* Update SDK version in build.gradle (#1741)

* release: Amplify Android 1.35.4 (#1742)

* release: Amplify Android 1.35.4

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>
Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Updating Create mutation to work with custom foreign keys.

* Fix format errors

* Updating Create mutation to work with custom foreign keys.

* Fix unit tests

* Fix format errors

* Fixing cascade delete on a child with custom primary key. (#1731)

Added support for cascade delete of a child object with custom primary key.

* chore: update gson version (#1744)

* Update notify_comments.yml (#1746)

* Update SDK version in build.gradle (#1747)

* release: Amplify Android 1.35.5 (#1748)

* release: Amplify Android 1.35.5

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>
Co-authored-by: Thomas Leing <bluezebragames@gmail.com>

* Fix typos

* Fix typos

* add comment

* Updating custom key models and adding a unit test with  no sort keys

* Updated comment models.   Added unit test for custom key with no  sort key.

* Updated tests and db models to match new schema version.  Added a test for model with a
custoom primary key and no sort keys.

* chore: update notify_release.yml (#1720)

* Update notify_release.yml

notify on published event (includes both release and pre-release).

* Update notify_release.yml

* Cpk bidirectional (#1751)

* Adding support for both child and parent with custom primary key in a bidirectional model.

* Fixing unit tests

* Updating models

* Updating models

* Fix create mutations for custom PK (#1740)

* Updated schema version of
testmodels/src/main/java/com/amplifyframework/testmodels/commentsblog/schema.graphql to the
latest version.

Also modified the schema to have a custom primary key with a foreign key relationship.   This
caused the schema to change so all of the tests that depended on that schema had to be updated
also.

 # Please enter the commit message for your changes. Lines starting

* Modifying create mutation to handle custom foreign keys.

* Updating Create mutation to work with custom foreign keys.

* Updating Create mutation to work with custom foreign keys.

* Fix format errors

* Updating Create mutation to work with custom foreign keys.

* Fix unit tests

* Fix format errors

* Fixing cascade delete on a child with custom primary key. (#1731)

Added support for cascade delete of a child object with custom primary key.

* Fix typos

* Fix typos

* add comment

* Updating custom key models and adding a unit test with  no sort keys

* Updated comment models.   Added unit test for custom key with no  sort key.

* Updated tests and db models to match new schema version.  Added a test for model with a
custoom primary key and no sort keys.

* some cleanup

* Update some unit tests to work with new schema version.

Co-authored-by: Michael Schneider <mikschn@amazon.com>
Co-authored-by: poojamat <poojamat@gmail.com>

* Added logic to delete with class name and predicate to support custom primary key.

* Revert "Added logic to delete with class name and predicate to support custom primary key."

This reverts commit 2852ec3.

* Delete with class and predicate as parameters support for custom primary key (#1760)

* Added logic to delete with class name and predicate to support custom primary key.

* Get pk (#1761)

* Fixing the code to get primary key field name when one of the field in composite pk is called id.

* Appsync mutation fk (#1762)

* appsync custom foreign key support for create mutation input variables.

* fix: start transfer service as foreground for >= API26 (#1759)

* fix: start transfer service as foreground for >= API26

* address PR comments

* added foreground service permission

Co-authored-by: Dhuka <sdhuka@98dd607e3407.ant.amazon.com>

* Fixing outbox event processed, (#1765)

* Fixing outbox event processed,

* Style changes

* ignore flaky test (#1768)

* upgrade jmespath to version 1.6.1 (#1766)

Fix error: Dependabot only supports uninterpolated string arguments to eval_gemfile. Got plugins_path

* Create closed_issue_message.yml (#1754)

* Bump SDK version to 2.48.0 (#1773)

* release version bump (#1774)

* Fix for adding data back to the delete request if it contains data as that is allowed for the Delete api (#1735)

* Fix for adding data back to the delete request if it contains data as that is allowed for the Delete api

* Addressed PR comments

* chore: Update CODEOWNERS [skip ci] (#1778)

Add amplify-data team as co-owner

* Fix/1485 : Fix for sending the session expired hub event when all credentials are expired (#1779)

* Fix for sending the session expired hub event when all credentials are expired

* Adding test that I had forgotten to commit

* chore: add PR guidelines (#1780)

* Updating build.gradle to include the latest version of the aws sdk (#1783)

* release: Amplify Android 1.35.7 (#1784)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* chore: update release_pr.yml (#1781)

Add input field to workflow action for release tag from which next release version and changelog should be calculated.

* chore: add statebot for pending response issues (#1785)

* chore: add statebot for pending response issues

* setup dry run

* chore: add GH workflow to automate projects (#1756)

* Create project_automation.yml

* Create priority_bumper.yml

* Suppress belongsto index (#1789)

* Fixing outbox event processed,

* Style changes

* Flutter fix for associated name.

* Suppress index creation when the index fields exists in belongs to.

* Updated test.

* Updated test.

* extract associated id for flutter.

* chore: update PR template (#1786)

add checkbox to confirm that author verified Pull Request guidelines are followed.

* Update build.gradle

* feat: Add flushEvents HubEvent for analytics (#1792)

* feat: Add flushEvents HubEvent for analytics

* fix lint errors and add loggings

* fix test

* rename hub events class and remove redundant variable

* release: Amplify Android 1.36.0 (#1796)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* fix orchestrator failing if emitter is disposed (#1755)

* fix orchestrator failing if emitter is disposed

* fix style

Co-authored-by: Divyesh Chitroda <div5yesh@gmail.com>

* test(datastore): Flutter update (#1801)

* For Flutter platform, do not format TIME or DATE_TIME object when converting from json.

* Responding to comments

* unit test update

* javadoc cleanup

* Unit test update

* Update unit tests

Co-authored-by: Michael Schneider <mikschn@amazon.com>

* catch exceptions from processOutboxItem (#1743)

* catch exceptions from processOutboxItem

processOutBoxItem should be wrapped to catch exceptions from the method as the blocking await only catches the timeout and returns false

https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling

* fix style

Co-authored-by: Michael Schneider <mikepschneider@users.noreply.github.com>

* ci: added canary workflow (#1770)

* chore: added canary workflow

* added back condition to run canary workflow

* added license header to source files

* release: Amplify Android 1.36.1

* Expand a catch clause to catch all (#1806)

Throwables.

This was throwing a null pointer which got
silently eaten up by RxJava.

Co-authored-by: Michael Schneider <mikschn@amazon.com>

* chore(datastore): Add SchemaDrift integration tests (#1800)

* chore(datastore): Add SchemaDrift integration tests

* fix checkstyle

* fix checkstyle

* fix checkstyle

* separate out the resource file to point to new backend

* release: Amplify Android 1.36.2 (#1812)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* Flutter fix (#1769)

* Fixing outbox event processed,

* Style changes

* Flutter fix for associated name.

* extract associated id for flutter.

* extract associated id for flutter.

* SerializedModelAdapter support for custom primary key.

* Fix NPE when extracting primary from nested model in flutter (#1799)

* Fix NPE when extracting primary from nested model in flutter

* Fix wrong else statement

* Wrap field name with backticks in where statement

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* Call to start TransferService regardless of if it has already been started

* Integration test fix (#1815)

* Fixing outbox event processed,

* Style changes

* Flutter fix for associated name.

* extract associated id for flutter.

* extract associated id for flutter.

* SerializedModelAdapter support for custom primary key.

* Fix NPE when extracting primary from nested model in flutter (#1799)

* Fix NPE when extracting primary from nested model in flutter

* Fix wrong else statement

* Wrap field name with backticks in where statement

* Avoid wrapping predicate field with backticks when in Android code base.

* Fixing integration tests with updated schema.

* Fixing integration tests with updated schema.

* Fixing integration tests with updated schema.

* Update pull_backend_config_from_s3

Updated pull backend config to include amplifyconfigurationupdated.json for updated schema for custom primary key.

* Fixing unit tests broken because of merges.

* Fixing unit tests broken because of merges.

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* Checkstyle fixes.

* Integration test fix (#1820)


* Fixing integration tests with updated schema.

* Fixing integration tests with updated schema.

* Fixing integration tests with updated schema.

* Update pull_backend_config_from_s3

Updated pull backend config to include amplifyconfigurationupdated.json for updated schema for custom primary key.

* Fixing unit tests broken because of merges.

* Fixing unit tests broken because of merges.

* Fixing Integration tess.

* Checkstyle fixes

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* Checkstyle fixes

* Increasing timeout for test.

* Ignoring flaky test.

* Integration test (#1821)

* Fixing Integration tests.

* Cleanup/ PR suggestions.

* Version update (#1825)

* Cpk version update (#1826)

* Version update

* Version update

* fix(api): catch all exceptions when making rest request (#1827)

* Fixing flutter sql predicate issue Version update. (#1832)

* Flutter update (#1833)

* Fixing flutter sql predicate issue Version update.

* Fixing flutter sql predicate.

* version update (#1837)

* release: Amplify Android 1.36.3 (#1839)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* Update transfer message in notification

* Update the Delete REST API to ensure it would work with and without a body (#1842)

* Chore(Release): Updating mobile client to the latest (#1847)

* Updating mobile client to the latest

* reverting change to see if the build passes

* Updating the library to use the latest aws sdk version

* release: Amplify Android 1.36.4 (#1856)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* Updating the version to 2.50.1 for AWS SDK (#1861)

* Reduce the importance level of transfer channel for foreground service to prevent sound/vibrate (#1860)

* release: Amplify Android 1.36.5 (#1863)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* Fix for flutter backtick

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/SQLiteCommandFactory.java

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* version update for flutter backtick

* fix(api): allow post request with empty body (#1864)

* release: Amplify Android 1.36.6

* update version numbers and removed miscellaneous section in changelog.md

* update version numbers and removed miscellaneous section in changelog.md

* update version numbers and removed miscellaneous section in changelog.md

* Moving TransferService responsibility to Amplify to track when to safely stop

* Set AmplifyTransferService to internal

* correct logic to stop transfer service

* Ensure startForeground is always called after startForegroundService

* Replace problematic startForegroundService with bind.

* Removing ignore from tests

* ktlint

* Update storage tests and add stress test

* fix import

* start unbind check in onServiceConnected to ensure handler is started on first transfer

* pr comments

* resolved merge conflict

* chore: update AWS SDK for Android version (#1880)

* release: Amplify Android 1.37.1 (#1881)

* release: Amplify Android 1.37.1

* update CHANGELOGs

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>
Co-authored-by: Erica Eaton <eatoeric@amazon.com>

* Update gradle.properties

Removing extra line.

* Run more devices in farm

* Update region

* change device filters

* Removing unused code.

* fixed codebuiled nonexhaustive loop

* fixed codebuiled nonexhaustive loop

* release: Amplify Android 1.37.2

* Update changelog

* chore: change pull request template (#1892)

* Fixing test failure because of list ordering.

* namespace test report for multiple devices

* chore: add device run suffix to test report generator (#1895)

* namespace test report for multiple devices

* namespace test report for multiple devices

* use job array index instead of arn

* Update generate_df_testrun_report

* lower polling on device farm

* fix merge errors

Co-authored-by: poojamat <poojamat@gmail.com>
Co-authored-by: poojamat <mathpooj@amazon.com>
Co-authored-by: Thomas Leing <bluezebragames@gmail.com>
Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>
Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>
Co-authored-by: gpanshu <91897496+gpanshu@users.noreply.github.com>
Co-authored-by: Divyesh Chitroda <div5yesh@gmail.com>
Co-authored-by: Thomas Leing <leint@amazon.com>
Co-authored-by: Tim Schmelter <schmelte+github@amazon.com>
Co-authored-by: Michael Schneider <mikschn@amazon.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>
Co-authored-by: Michael Schneider <mikepschneider@users.noreply.github.com>
Co-authored-by: Saijad Dhuka <83975678+sdhuka@users.noreply.github.com>
Co-authored-by: Dhuka <sdhuka@98dd607e3407.ant.amazon.com>
Co-authored-by: Joseph Lawson <joe.lawson@dexcom.com>
Co-authored-by: yeung-wah <94481720+yeung-wah@users.noreply.github.com>
Co-authored-by: Tyler Roach <tylerjroach@gmail.com>
Co-authored-by: Michael Law <1365977+lawmicha@users.noreply.github.com>
Co-authored-by: Tyler Roach <tjroach@amazon.com>
Co-authored-by: Banji Jolaoso <banjij@amazon.com>
Co-authored-by: Erica Eaton <eatoeric@amazon.com>
Co-authored-by: Sunil Timalsina <sunil.timalsina@gmail.com>
sdhuka added a commit that referenced this pull request Aug 25, 2022
* Send snapshot on updates which render an item in list to not qualify a predicate.

* Revert "Send snapshot on updates which render an item in list to not qualify a predicate."

This reverts commit 4665a7b

* Adding create composite primary key on sqllite table (#1590)

* Adding create composite primary key on sqllite table

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/SQLiteCommandFactory.java

typo

Co-authored-by: Thomas Leing <bluezebragames@gmail.com>

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/SQLiteCommandFactory.java

Co-authored-by: Thomas Leing <bluezebragames@gmail.com>

Co-authored-by: Thomas Leing <bluezebragames@gmail.com>

* Adding support for custom primary key across the codebase.

* Adding support for custom primary key across the codebase.

* Added default implementation for resolveIdentifier in Model interface, to make it backwards compatible.

* Added default implementation for resolveIdentifier in Model interface, to make it backwards compatible.

* Added default implementation for resolveIdentifier in Model interface, to make it backwards compatible.

* Work in progress Custom primary key in storage engine.

* Work in progress Custom primary key in storage engine.

* test fixes and check style.

* Adding custom primary key support to SerializedModel.

* Updating selection set of leaf element to get primary key fields from the schema.

* Added __typename to appsync selection set so the type can be computed for flutter serialized models.

* Fixed integration test.

* Fixed sql index on undefined index not getting created.

* Fixed sql index on undefined index not getting created.

* Reverting not needed change.

* Clean up and updated concatenation logic for primary key.

* Making SerializedModel resolve identifier return Serializable.

* Checkstyle fixes.

* Updated concatenation code for model primary key.

* Test fix.

* Test fix.

* Test fix.

* Test fix.

* Test fix.

* Optimization to make @@primary key only in case of composite primary key.

* Clean up

* Increasing timeout for flaky test.

* Ignoring the test failing in the build.

* Increasing timeout on AWSDatastore plugin for tests.

* Updating where.identifier method.

* Increasing timeout for slow running test.

* Update testmodels/src/main/java/com/amplifyframework/testmodels/personcar/PersonWithCPK.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update aws-api-appsync/src/main/java/com/amplifyframework/datastore/appsync/ModelMetadata.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update aws-api-appsync/src/main/java/com/amplifyframework/datastore/appsync/ModelMetadata.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update aws-api-appsync/src/main/java/com/amplifyframework/datastore/appsync/ModelMetadata.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Code review suggestions.

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/adapter/SQLiteColumn.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update core/src/main/java/com/amplifyframework/core/model/ModelPrimaryKey.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Update aws-datastore/src/androidTest/java/com/amplifyframework/datastore/BasicCloudSyncInstrumentationTest.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Code review suggestions.

* Increasing time out for orchestrator semaphore

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/SqlQueryProcessor.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Formatting fixes.

* PR suggestions.

* Update core/src/main/java/com/amplifyframework/core/model/ModelPrimaryKey.java

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* Update core/src/main/java/com/amplifyframework/core/model/ModelPrimaryKey.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Deprecating where.id method.

* Checkstyle

* where.id deprecation in datastore integration tests.

* Code optimization to create SQL index for primary key fields only if it is a composite.

* Fixed flaky test.

* Added an integration test for a flaky unit test.

* fix(datastore): #1584 When DateTimeParseException is not available for lower apis (#1701)

* Removed dataTimeParseException class as it is not available in api < 25

* Fixed the failing temporaldatetimetest

Co-authored-by: Divyesh Chitroda <div5yesh@gmail.com>

* Refactored the code around sync expression predicate of QueryPredicates.all and QueryPredicates.none().

* Checkstyle

* Removing integration test for custom primary untill I find a way to fix the environment.

* Version bumps (#1721)

* Version bumps

* Empty commit to bump codebuild

Co-authored-by: Thomas Leing <leint@amazon.com>

* chore: add geo to bug and feature report templates (#1722)

* Accidental change.

* Indentations.

* Update changelog after manual release v1.35.3 (#1724)

* Update changelog after manual release v1.35.3

* Update core-kotlin changelog as well

Co-authored-by: Thomas Leing <leint@amazon.com>

* Fixing get unique key function on Model primary key helper.

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/adapter/SQLiteTable.java

Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Fixing cascade delete on a child with custom primary key. (#1731)

Added support for cascade delete of a child object with custom primary key.

* chore: Update CODEOWNERS [skip ci] (#1733)

Update CODEOWNERS file to use new team structure

* Updated schema version of
testmodels/src/main/java/com/amplifyframework/testmodels/commentsblog/schema.graphql to the
latest version.

Also modified the schema to have a custom primary key with a foreign key relationship.   This
caused the schema to change so all of the tests that depended on that schema had to be updated
also.

 # Please enter the commit message for your changes. Lines starting

* Modifying create mutation to handle custom foreign keys.

* Updating Create mutation to work with custom foreign keys.

* chore: notify comments on closed issues (#1739)

* Update notify_comments.yml

* update comments

* Update SDK version in build.gradle (#1741)

* release: Amplify Android 1.35.4 (#1742)

* release: Amplify Android 1.35.4

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>
Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>

* Updating Create mutation to work with custom foreign keys.

* Fix format errors

* Updating Create mutation to work with custom foreign keys.

* Fix unit tests

* Fix format errors

* Fixing cascade delete on a child with custom primary key. (#1731)

Added support for cascade delete of a child object with custom primary key.

* chore: update gson version (#1744)

* Update notify_comments.yml (#1746)

* Update SDK version in build.gradle (#1747)

* release: Amplify Android 1.35.5 (#1748)

* release: Amplify Android 1.35.5

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>
Co-authored-by: Thomas Leing <bluezebragames@gmail.com>

* Fix typos

* Fix typos

* add comment

* Updating custom key models and adding a unit test with  no sort keys

* Updated comment models.   Added unit test for custom key with no  sort key.

* Updated tests and db models to match new schema version.  Added a test for model with a
custoom primary key and no sort keys.

* chore: update notify_release.yml (#1720)

* Update notify_release.yml

notify on published event (includes both release and pre-release).

* Update notify_release.yml

* Cpk bidirectional (#1751)

* Adding support for both child and parent with custom primary key in a bidirectional model.

* Fixing unit tests

* Updating models

* Updating models

* Fix create mutations for custom PK (#1740)

* Updated schema version of
testmodels/src/main/java/com/amplifyframework/testmodels/commentsblog/schema.graphql to the
latest version.

Also modified the schema to have a custom primary key with a foreign key relationship.   This
caused the schema to change so all of the tests that depended on that schema had to be updated
also.

 # Please enter the commit message for your changes. Lines starting

* Modifying create mutation to handle custom foreign keys.

* Updating Create mutation to work with custom foreign keys.

* Updating Create mutation to work with custom foreign keys.

* Fix format errors

* Updating Create mutation to work with custom foreign keys.

* Fix unit tests

* Fix format errors

* Fixing cascade delete on a child with custom primary key. (#1731)

Added support for cascade delete of a child object with custom primary key.

* Fix typos

* Fix typos

* add comment

* Updating custom key models and adding a unit test with  no sort keys

* Updated comment models.   Added unit test for custom key with no  sort key.

* Updated tests and db models to match new schema version.  Added a test for model with a
custoom primary key and no sort keys.

* some cleanup

* Update some unit tests to work with new schema version.

Co-authored-by: Michael Schneider <mikschn@amazon.com>
Co-authored-by: poojamat <poojamat@gmail.com>

* Added logic to delete with class name and predicate to support custom primary key.

* Revert "Added logic to delete with class name and predicate to support custom primary key."

This reverts commit 2852ec3.

* Delete with class and predicate as parameters support for custom primary key (#1760)

* Added logic to delete with class name and predicate to support custom primary key.

* Get pk (#1761)

* Fixing the code to get primary key field name when one of the field in composite pk is called id.

* Appsync mutation fk (#1762)

* appsync custom foreign key support for create mutation input variables.

* fix: start transfer service as foreground for >= API26 (#1759)

* fix: start transfer service as foreground for >= API26

* address PR comments

* added foreground service permission

Co-authored-by: Dhuka <sdhuka@98dd607e3407.ant.amazon.com>

* Fixing outbox event processed, (#1765)

* Fixing outbox event processed,

* Style changes

* ignore flaky test (#1768)

* upgrade jmespath to version 1.6.1 (#1766)

Fix error: Dependabot only supports uninterpolated string arguments to eval_gemfile. Got plugins_path

* Create closed_issue_message.yml (#1754)

* Bump SDK version to 2.48.0 (#1773)

* release version bump (#1774)

* Fix for adding data back to the delete request if it contains data as that is allowed for the Delete api (#1735)

* Fix for adding data back to the delete request if it contains data as that is allowed for the Delete api

* Addressed PR comments

* chore: Update CODEOWNERS [skip ci] (#1778)

Add amplify-data team as co-owner

* Fix/1485 : Fix for sending the session expired hub event when all credentials are expired (#1779)

* Fix for sending the session expired hub event when all credentials are expired

* Adding test that I had forgotten to commit

* chore: add PR guidelines (#1780)

* Updating build.gradle to include the latest version of the aws sdk (#1783)

* release: Amplify Android 1.35.7 (#1784)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* chore: update release_pr.yml (#1781)

Add input field to workflow action for release tag from which next release version and changelog should be calculated.

* chore: add statebot for pending response issues (#1785)

* chore: add statebot for pending response issues

* setup dry run

* chore: add GH workflow to automate projects (#1756)

* Create project_automation.yml

* Create priority_bumper.yml

* Suppress belongsto index (#1789)

* Fixing outbox event processed,

* Style changes

* Flutter fix for associated name.

* Suppress index creation when the index fields exists in belongs to.

* Updated test.

* Updated test.

* extract associated id for flutter.

* chore: update PR template (#1786)

add checkbox to confirm that author verified Pull Request guidelines are followed.

* Update build.gradle

* feat: Add flushEvents HubEvent for analytics (#1792)

* feat: Add flushEvents HubEvent for analytics

* fix lint errors and add loggings

* fix test

* rename hub events class and remove redundant variable

* release: Amplify Android 1.36.0 (#1796)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* fix orchestrator failing if emitter is disposed (#1755)

* fix orchestrator failing if emitter is disposed

* fix style

Co-authored-by: Divyesh Chitroda <div5yesh@gmail.com>

* test(datastore): Flutter update (#1801)

* For Flutter platform, do not format TIME or DATE_TIME object when converting from json.

* Responding to comments

* unit test update

* javadoc cleanup

* Unit test update

* Update unit tests

Co-authored-by: Michael Schneider <mikschn@amazon.com>

* catch exceptions from processOutboxItem (#1743)

* catch exceptions from processOutboxItem

processOutBoxItem should be wrapped to catch exceptions from the method as the blocking await only catches the timeout and returns false

https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling

* fix style

Co-authored-by: Michael Schneider <mikepschneider@users.noreply.github.com>

* ci: added canary workflow (#1770)

* chore: added canary workflow

* added back condition to run canary workflow

* added license header to source files

* release: Amplify Android 1.36.1

* Expand a catch clause to catch all (#1806)

Throwables.

This was throwing a null pointer which got
silently eaten up by RxJava.

Co-authored-by: Michael Schneider <mikschn@amazon.com>

* chore(datastore): Add SchemaDrift integration tests (#1800)

* chore(datastore): Add SchemaDrift integration tests

* fix checkstyle

* fix checkstyle

* fix checkstyle

* separate out the resource file to point to new backend

* release: Amplify Android 1.36.2 (#1812)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* Flutter fix (#1769)

* Fixing outbox event processed,

* Style changes

* Flutter fix for associated name.

* extract associated id for flutter.

* extract associated id for flutter.

* SerializedModelAdapter support for custom primary key.

* Fix NPE when extracting primary from nested model in flutter (#1799)

* Fix NPE when extracting primary from nested model in flutter

* Fix wrong else statement

* Wrap field name with backticks in where statement

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* Call to start TransferService regardless of if it has already been started

* Integration test fix (#1815)

* Fixing outbox event processed,

* Style changes

* Flutter fix for associated name.

* extract associated id for flutter.

* extract associated id for flutter.

* SerializedModelAdapter support for custom primary key.

* Fix NPE when extracting primary from nested model in flutter (#1799)

* Fix NPE when extracting primary from nested model in flutter

* Fix wrong else statement

* Wrap field name with backticks in where statement

* Avoid wrapping predicate field with backticks when in Android code base.

* Fixing integration tests with updated schema.

* Fixing integration tests with updated schema.

* Fixing integration tests with updated schema.

* Update pull_backend_config_from_s3

Updated pull backend config to include amplifyconfigurationupdated.json for updated schema for custom primary key.

* Fixing unit tests broken because of merges.

* Fixing unit tests broken because of merges.

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* Checkstyle fixes.

* Integration test fix (#1820)

* Fixing integration tests with updated schema.

* Fixing integration tests with updated schema.

* Fixing integration tests with updated schema.

* Update pull_backend_config_from_s3

Updated pull backend config to include amplifyconfigurationupdated.json for updated schema for custom primary key.

* Fixing unit tests broken because of merges.

* Fixing unit tests broken because of merges.

* Fixing Integration tess.

* Checkstyle fixes

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* Checkstyle fixes

* Increasing timeout for test.

* Ignoring flaky test.

* Integration test (#1821)

* Fixing Integration tests.

* Cleanup/ PR suggestions.

* Version update (#1825)

* Cpk version update (#1826)

* Version update

* Version update

* fix(api): catch all exceptions when making rest request (#1827)

* Fixing flutter sql predicate issue Version update. (#1832)

* Flutter update (#1833)

* Fixing flutter sql predicate issue Version update.

* Fixing flutter sql predicate.

* version update (#1837)

* release: Amplify Android 1.36.3 (#1839)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* Update transfer message in notification

* Update the Delete REST API to ensure it would work with and without a body (#1842)

* Chore(Release): Updating mobile client to the latest (#1847)

* Updating mobile client to the latest

* reverting change to see if the build passes

* Updating the library to use the latest aws sdk version

* release: Amplify Android 1.36.4 (#1856)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* Updating the version to 2.50.1 for AWS SDK (#1861)

* Reduce the importance level of transfer channel for foreground service to prevent sound/vibrate (#1860)

* release: Amplify Android 1.36.5 (#1863)

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>

* Fix for flutter backtick

* Update aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/SQLiteCommandFactory.java

Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>

* version update for flutter backtick

* fix(api): allow post request with empty body (#1864)

* release: Amplify Android 1.36.6

* update version numbers and removed miscellaneous section in changelog.md

* update version numbers and removed miscellaneous section in changelog.md

* update version numbers and removed miscellaneous section in changelog.md

* Moving TransferService responsibility to Amplify to track when to safely stop

* Set AmplifyTransferService to internal

* correct logic to stop transfer service

* Ensure startForeground is always called after startForegroundService

* Replace problematic startForegroundService with bind.

* Removing ignore from tests

* ktlint

* Update storage tests and add stress test

* fix import

* start unbind check in onServiceConnected to ensure handler is started on first transfer

* pr comments

* resolved merge conflict

* chore: update AWS SDK for Android version (#1880)

* release: Amplify Android 1.37.1 (#1881)

* release: Amplify Android 1.37.1

* update CHANGELOGs

Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>
Co-authored-by: Erica Eaton <eatoeric@amazon.com>

* Update gradle.properties

Removing extra line.

* Run more devices in farm

* Update region

* change device filters

* Removing unused code.

* fixed codebuiled nonexhaustive loop

* fixed codebuiled nonexhaustive loop

* release: Amplify Android 1.37.2

* Update changelog

* chore: change pull request template (#1892)

* Fixing test failure because of list ordering.

* namespace test report for multiple devices

* chore: add device run suffix to test report generator (#1895)

* namespace test report for multiple devices

* namespace test report for multiple devices

* use job array index instead of arn

* Update generate_df_testrun_report

* lower polling on device farm

* fix merge errors

Co-authored-by: poojamat <poojamat@gmail.com>
Co-authored-by: poojamat <mathpooj@amazon.com>
Co-authored-by: Thomas Leing <bluezebragames@gmail.com>
Co-authored-by: Erica Eaton <67125657+eeatonaws@users.noreply.github.com>
Co-authored-by: Hui Zhao <10602282+HuiSF@users.noreply.github.com>
Co-authored-by: gpanshu <91897496+gpanshu@users.noreply.github.com>
Co-authored-by: Divyesh Chitroda <div5yesh@gmail.com>
Co-authored-by: Thomas Leing <leint@amazon.com>
Co-authored-by: Tim Schmelter <schmelte+github@amazon.com>
Co-authored-by: Michael Schneider <mikschn@amazon.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: amplify-android-dev+ghops <amplify-android-dev+ghops@amazon.com>
Co-authored-by: Michael Schneider <mikepschneider@users.noreply.github.com>
Co-authored-by: Saijad Dhuka <83975678+sdhuka@users.noreply.github.com>
Co-authored-by: Dhuka <sdhuka@98dd607e3407.ant.amazon.com>
Co-authored-by: Joseph Lawson <joe.lawson@dexcom.com>
Co-authored-by: yeung-wah <94481720+yeung-wah@users.noreply.github.com>
Co-authored-by: Tyler Roach <tylerjroach@gmail.com>
Co-authored-by: Michael Law <1365977+lawmicha@users.noreply.github.com>
Co-authored-by: Tyler Roach <tjroach@amazon.com>
Co-authored-by: Banji Jolaoso <banjij@amazon.com>
Co-authored-by: Erica Eaton <eatoeric@amazon.com>
Co-authored-by: Sunil Timalsina <sunil.timalsina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants