aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.33k stars 248 forks source link

Newest version removes createdAt and updatedAt which kills Datastore and App #3540

Closed thomasklaush closed 10 months ago

thomasklaush commented 1 year ago

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v18.7.0

Amplify CLI Version

12.2.0

What operating system are you using?

Windows cli for Flutter

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

Describe the bug

createdAt and updatedAt gets removed which is killing Datastore. Auto Merge Enabled as requested. Also modifications for jdk 8 on Android are done.

Expected behavior

Datastore working with generated models.

Reproduction steps

use codegen models for Flutter

Project Identifier

8ea06d0a6144f2b4a7991557bc74a3c8

Log output

dd

Additional information

ddd

Before submitting, please confirm:

ykethan commented 1 year ago

hey, 👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂

AnilMaktala commented 1 year ago

Hey, 👋 thanks for raising this! I'm going to transfer this over to our codegen repository for better assistance 🙂

alharris-at commented 1 year ago

Hi @thomasklaush - I just attempted to reproduce this issue using Amplify CLI v12.2.1, and I am seeing the fields generated in the model.

Could you provide a stack trace, as well as some sample code which we can execute to attempt to reproduce this issue? I have your schema, but if you're able to produce a minimal repro I may be able to see what's going on a bit better.

For example, using a graphql model looking like:

type TestModel @model(timestamps: { createdAt: "createdAt", updatedAt: "updatedAt" }) {
  createdAt: AWSDateTime
  updatedAt: AWSDateTime
}

Generates a model file looking something like this (toJson, and other utility methods removed for brevity)

import 'ModelProvider.dart';
import 'package:amplify_core/amplify_core.dart' as amplify_core;

class TestModel extends amplify_core.Model {
  static const classType = const _TestModelModelType();
  final String id;
  final amplify_core.TemporalDateTime? _createdAt;
  final amplify_core.TemporalDateTime? _updatedAt;

  TestModelModelIdentifier get modelIdentifier {
      return TestModelModelIdentifier(
        id: id
      );
  }

  amplify_core.TemporalDateTime? get createdAt {
    return _createdAt;
  }

  amplify_core.TemporalDateTime? get updatedAt {
    return _updatedAt;
  }

  const TestModel._internal({required this.id, createdAt, updatedAt}): _createdAt = createdAt, _updatedAt = updatedAt;

  factory TestModel({String? id, amplify_core.TemporalDateTime? createdAt, amplify_core.TemporalDateTime? updatedAt}) {
    return TestModel._internal(
      id: id == null ? amplify_core.UUID.getUUID() : id,
      createdAt: createdAt,
      updatedAt: updatedAt);
  }

  static final amplify_core.QueryModelIdentifier<TestModelModelIdentifier> MODEL_IDENTIFIER = amplify_core.QueryModelIdentifier<TestModelModelIdentifier>();
  static final ID = amplify_core.QueryField(fieldName: "id");
  static final CREATEDAT = amplify_core.QueryField(fieldName: "createdAt");
  static final UPDATEDAT = amplify_core.QueryField(fieldName: "updatedAt");
  static var schema = amplify_core.Model.defineSchema(define: (amplify_core.ModelSchemaDefinition modelSchemaDefinition) {
    modelSchemaDefinition.name = "TestModel";
    modelSchemaDefinition.pluralName = "UserStatusEntries";

    modelSchemaDefinition.addField(amplify_core.ModelFieldDefinition.id());

    modelSchemaDefinition.addField(amplify_core.ModelFieldDefinition.field(
      key: TestModel.CREATEDAT,
      isRequired: false,
      ofType: amplify_core.ModelFieldType(amplify_core.ModelFieldTypeEnum.dateTime)
    ));

    modelSchemaDefinition.addField(amplify_core.ModelFieldDefinition.field(
      key: TestModel.UPDATEDAT,
      isRequired: false,
      ofType: amplify_core.ModelFieldType(amplify_core.ModelFieldTypeEnum.dateTime)
    ));
  });
}

class _TestModelModelType extends amplify_core.ModelType<TestModel> {
  const _TestModelModelType();
}

class TestModelModelIdentifier implements amplify_core.ModelIdentifier<TestModel> {
  final String id;

  const TestModelModelIdentifier({
    required this.id});
thomasklaush commented 1 year ago

Hi @alharris-at,

prior to it was created with @model

Now I need to explicitly define it

type TestModel @model(timestamps: { createdAt: "createdAt", updatedAt: "updatedAt" }) {
  createdAt: AWSDateTime
  updatedAt: AWSDateTime
}
dpilch commented 1 year ago

@thomasklaush it looks like your amplify/cli.json is missing a few options. Have you recently made changes to this file?

Please add features.codegen.addtimestampfields with the value set to true.

{
  "features": {
    "codegen": {
      "addtimestampfields": true
    }
  }
}

https://docs.amplify.aws/cli/reference/feature-flags/#addTimestampFields

thomasklaush commented 1 year ago

Yes, you are right, I added something.

To use GraphQl API as well I needed the ModelIdentifier.

so I added: "respectprimarykeyattributesonconnectionfield": true,

So most properly this was the reason

thomasklaush commented 1 year ago

@dpilch it seems the core issue was another one.

The null pointer exception which is killing the abb:

I/amplify:aws-datastore(31990): Starting processing subscription events.
W/amplify:aws-datastore(31990): An error occurred on the remote ON_DELETE subscription for model ExerciseEntry
W/amplify:aws-datastore(31990): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(31990):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)

is due to the @auth directive.

@auth(rules: [
  { allow: private, operations: [read]},
  {allow: groups, groupsField: "groups"},
    ])

is the reason for the crash

dpilch commented 1 year ago

I just noticed you have a couple of duplicate flags in your amplify/cli.json file.

features.graphQLTransformer.useExperimentalPipelinedTransformer and features.graphQLTransformer.enableIterativeGSIUpdates both have duplicates with different values. I'm not certain what effect this would have. Could you try removing the duplicates and using your desired value.

thomasklaush commented 1 year ago

@dpilch i've cleared this, thanks for the input.

The root cause is still a different.

@auth(rules: [ { allow: private, operations: [read]}, {allow: groups, groupsField: "groups"}, ])

leads to an Error and breaks the App. If I comment out the groups, everything works fine:

@auth(rules: [ { allow: private, operations: [read]},

{allow: groups, groupsField: "groups"},

])

On Web, I use Users with a group value and works fine as well. Android is getting killed.

ragingsquirrel3 commented 1 year ago

@thomasklaush do you mind including the code snippet that causes error/breaks the app, as well as the stack trace (is it same error from earlier comment)? You had originally mentioned this is a Datastore issue but since you mentioned it works on web are you now doing this with API category instead?

Jordan-Nelson commented 1 year ago

@thomasklaush if you are still facing this issue, can you please take a look at the questions in the comment above? Thanks.

thomasklaush commented 1 year ago

@thomasklaush if you are still facing this issue, can you please take a look at the questions in the comment above? Thanks.

It's a bit of a tricky situation. I'm now sure, it's not the issue with createdAt und updatedAt. After some investigation it showed up, that Class level Authentication of the GraphQL leads to the issue.

So the issue is amplify datastore or amplify cli codegeneration

GraphQL Schema auth is:

  { allow: private, operations: [read]},
  # {allow: groups, groupsField: "groups"},
  ]) {

I have to use the # prior to amplify codegen models, because the Android App crashes immediately after the start of the Datastore. When I update the backend, I have to remove the #, because I need the group level authentication for the web portal. Reason is, web portal users in a special modifier group can modify, app users can just view.

The addition of

amplify_core.AuthRule(
        authStrategy: amplify_core.AuthStrategy.GROUPS,
        groupClaim: "cognito:groups",
        groupsField: "groups",
        provider: amplify_core.AuthRuleProvider.USERPOOLS,
        operations: const [
          amplify_core.ModelOperation.CREATE,
          amplify_core.ModelOperation.UPDATE,
          amplify_core.ModelOperation.DELETE,
          amplify_core.ModelOperation.READ
        ])

in the modelSchemaDefinition.authRules = [

kills the App.

Error Log:

I/amplify:aws-datastore(20350): Stopped subscription processor.
W/amplify:aws-datastore(20350): API sync failed - transitioning to LOCAL_ONLY.
W/amplify:aws-datastore(20350): DataStoreException{message=Error during subscription., cause=ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$2(AppSyncClient.java:322)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda5.accept(Unknown Source:4)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:324)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.onDelete(AppSyncClient.java:284)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda11.subscribe(Unknown Source:7)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda15.subscribe(Unknown Source:11)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(20350):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
W/amplify:aws-datastore(20350):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(20350): Caused by: ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:73)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:87)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getAuthToken(AuthRuleRequestDecorator.java:226)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getIdentityValue(AuthRuleRequestDecorator.java:152)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:121)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(20350):     ... 20 more
W/amplify:aws-datastore(20350): Caused by: java.lang.InterruptedException
W/amplify:aws-datastore(20350):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1040)
W/amplify:aws-datastore(20350):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
W/amplify:aws-datastore(20350):     at java.util.concurrent.Semaphore.acquire(Semaphore.java:318)
W/amplify:aws-datastore(20350): API sync failed - transitioning to LOCAL_ONLY.
W/amplify:aws-datastore(20350): DataStoreException{message=Error during subscription., cause=ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$2(AppSyncClient.java:322)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda5.accept(Unknown Source:4)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:324)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.onCreate(AppSyncClient.java:248)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda14.subscribe(Unknown Source:7)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda15.subscribe(Unknown Source:11)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(20350):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
W/amplify:aws-datastore(20350):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(20350): Caused by: ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:73)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:87)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getAuthToken(AuthRuleRequestDecorator.java:226)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getIdentityValue(AuthRuleRequestDecorator.java:152)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:121)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(20350):     ... 20 more
W/amplify:aws-datastore(20350): Caused by: java.lang.InterruptedException
W/amplify:aws-datastore(20350):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1040)
W/amplify:aws-datastore(20350):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
W/amplify:aws-datastore(20350):     at java.util.concurrent.Semaphore.acquire(Semaphore.java:318)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:71)
W/amplify:aws-datastore(20350):     ... 26 more
I/amplify:aws-datastore(20350): Setting currentState to LOCAL_ONLY
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:71)
W/amplify:aws-datastore(20350):     ... 26 more
W/amplify:aws-datastore(20350): API sync failed - transitioning to LOCAL_ONLY.
W/amplify:aws-datastore(20350): DataStoreException{message=Error during subscription., cause=ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$2(AppSyncClient.java:322)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda5.accept(Unknown Source:4)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:324)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.appsync.AppSyncClient.onCreate(AppSyncClient.java:248)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda14.subscribe(Unknown Source:7)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(20350):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda15.subscribe(Unknown Source:11)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(20350):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(20350):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
W/amplify:aws-datastore(20350):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
W/amplify:aws-datastore(20350):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(20350): Caused by: ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:73)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:87)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getAuthToken(AuthRuleRequestDecorator.java:226)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getIdentityValue(AuthRuleRequestDecorator.java:152)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:121)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(20350):     ... 20 more
W/amplify:aws-datastore(20350): Caused by: java.lang.InterruptedException
W/amplify:aws-datastore(20350):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1040)
W/amplify:aws-datastore(20350):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
W/amplify:aws-datastore(20350):     at java.util.concurrent.Semaphore.acquire(Semaphore.java:318)
W/amplify:aws-datastore(20350):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:71)
W/amplify:aws-datastore(20350):     ... 26 more
W/FirebaseCrashlytics(20350): Timeout exceeded while awaiting app exception callback from Analytics listener.
E/AndroidRuntime(20350): FATAL EXCEPTION: RxCachedThreadScheduler-16
E/AndroidRuntime(20350): Process: com.xxx.xxx, PID: 20350
E/AndroidRuntime(20350): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
E/AndroidRuntime(20350):    at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
E/AndroidRuntime(20350):    at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
E/AndroidRuntime(20350):    at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
E/AndroidRuntime(20350):    at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
E/AndroidRuntime(20350):    at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
E/AndroidRuntime(20350):    at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
E/AndroidRuntime(20350):    at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
E/AndroidRuntime(20350):    at com.amplifyframework.datastore.appsync.AppSyncClient.onCreate(AppSyncClient.java:248)
E/AndroidRuntime(20350):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda14.subscribe(Unknown Source:7)
E/AndroidRuntime(20350):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
E/AndroidRuntime(20350):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda15.subscribe(Unknown Source:11)
E/AndroidRuntime(20350):    at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
E/AndroidRuntime(20350):    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
E/AndroidRuntime(20350):    at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
E/AndroidRuntime(20350):    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
E/AndroidRuntime(20350):    at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
E/AndroidRuntime(20350):    at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
E/AndroidRuntime(20350):    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
E/AndroidRuntime(20350):    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
E/AndroidRuntime(20350):    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
E/AndroidRuntime(20350):    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
E/AndroidRuntime(20350):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
E/AndroidRuntime(20350):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
E/AndroidRuntime(20350):    at java.lang.Thread.run(Thread.java:1012)
I/Process (20350): Sending signal. PID: 20350 SIG: 9
Lost connection to device.
Exited (sigterm)
Jordan-Nelson commented 1 year ago

Hello @thomasklaush - I having a hard time following the thread here. It seems like the issue may have changed at some point. Do you mind describing the current issue that you are having?

Can you also provide reproduction steps so that we can try to reproduce this? Please share your full schema as well. Thanks.

thomasklaush commented 1 year ago

@Jordan-Nelson yes, you're right. The original Issue isn't an issue any more, maybe never caused the issue. Just look at the last post. I've tested it with the newest version again and it kills the app.

If I add the {allow: groups, groupsField: "groups"}, the App dies. Could be from the model generator or from the datastore package.

tedevel commented 1 year ago

I can second the issue reported by @thomasklaush. I have been developing successfully in iOS for months. I am now making sure this app will build for Android and I get a hard crash the moment I get through a user sign-on and datastore subscriptions are started.

Here is an example of my schema:

type TripSample
  @model 
  @auth( rules: [
    { allow: groups, groups: ["Admin"], operations: [create,read,update,delete]},
    { allow: groups, groups: ["User"], operations: [read]},
    { allow: groups, groupsField: "ownerID", operations: [read] }
  ])
{
  id: ID!  
  timestamp: AWSTimestamp
  data: String
  tripID: ID @index(name: "byTrip", sortKeyFields: ["timestamp"])
  trip: Trip @belongsTo(fields: ["tripID"])
  ownerID: ID  

}

type Trip 
  @model 
  @auth( rules: [
    { allow: groups, groups: ["Admin"], operations: [create,read,update,delete]},
    { allow: groups, groups: ["User"], operations: [read]},
    { allow: groups, groupsField: "ownerID", operations: [read] }
  ]) 
{
  id: ID! 
  secondaryID: ID  @index 
  samples: [TripSample] @hasMany(indexName: "byTrip", fields: ["id"])
}

type Owner 
  @model 
  @auth( rules: [
    { allow: groups, groups: ["Admin"], operations: [create,read,update,delete]},
    { allow: groups, groups: ["User"], operations: [read]},
    { allow: groups, groupsField: "id", operations: [read] }
  ]) 
{
  id: ID! # name
  data: String
  trips: [Trip] @hasMany(fields: ["id"])
}

Here are the relevant dependencies:

environment:
  sdk: '>=2.18.0 <3.13.8'

dependencies:
  amplify_api: ^1.6.0
  amplify_auth_cognito: ^1.6.0
  amplify_authenticator: ^1.4.0
  amplify_datastore: ^1.6.0
  amplify_flutter: ^1.6.0
  amplify_storage_s3: ^1.4.0

And here is the crash log:


I/amplify:flutter:datastore(16987): Added Auth plugin
I/amplify:flutter:datastore(16987): Added API plugin
I/amplify:aws-datastore(16987): Creating table: LastSyncMetadata
I/amplify:aws-datastore(16987): Creating table: PersistentRecord
I/amplify:aws-datastore(16987): Creating table: Trip
I/amplify:aws-datastore(16987): Creating table: PersistentModelVersion
I/amplify:aws-datastore(16987): Creating table: TripSample
I/amplify:aws-datastore(16987): Creating table: TripEvent
I/amplify:aws-datastore(16987): Creating table: Owner
I/amplify:aws-datastore(16987): Creating table: ModelMetadata
I/amplify:aws-datastore(16987): Creating index for table: Trip
I/amplify:aws-datastore(16987): Creating index for table: TripEvent
I/amplify:aws-datastore(16987): Creating index for table: PersistentRecord
I/amplify:aws-datastore(16987): Creating index for table: Trip
I/amplify:aws-datastore(16987): Creating index for table: TripSample
I/amplify:aws-datastore(16987): Creating index for table: Trip
I/amplify:aws-datastore(16987): DataStore plugin initialized.
I/amplify:flutter:datastore(16987): Unhandled DataStoreHubEvent: SUCCEEDED
I/amplify:flutter:datastore(16987): com.amplifyframework.core.category.CategoryInitializationResult@c4e4bc8
I/flutter (16987): listening to trips
I/amplify:aws-datastore(16987): Orchestrator lock acquired.
I/amplify:aws-datastore(16987): DataStore plugin initialized.
I/amplify:aws-datastore(16987): Orchestrator transitioning from STOPPED to SYNC_VIA_API
I/amplify:aws-datastore(16987): Starting to observe local storage changes.
I/amplify:aws-datastore(16987): Now observing local storage. Local changes will be enqueued to mutation outbox.
I/amplify:aws-datastore(16987): Setting currentState to LOCAL_ONLY
I/amplify:aws-datastore(16987): Setting currentState to SYNC_VIA_API
I/amplify:aws-datastore(16987): Orchestrator lock released.
I/amplify:flutter:datastore(16987): Established a new stream form flutter com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter$$ExternalSyntheticLambda10@bdd77da
I/amplify:aws-datastore(16987): Starting API synchronization mode.
I/amplify:aws-datastore(16987): Starting processing subscription events.
W/amplify:aws-datastore(16987): An error occurred on the remote ON_DELETE subscription for model TripEvent
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onDelete(AppSyncClient.java:284)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda17.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(16987): An error occurred on the remote ON_CREATE subscription for model Trip
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onCreate(AppSyncClient.java:248)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda16.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(16987): An error occurred on the remote ON_DELETE subscription for model TripSample
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onDelete(AppSyncClient.java:284)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda17.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(16987): An error occurred on the remote ON_CREATE subscription for model Owner
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onCreate(AppSyncClient.java:248)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda16.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(16987): An error occurred on the remote ON_DELETE subscription for model Owner
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onDelete(AppSyncClient.java:284)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda17.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(16987): An error occurred on the remote ON_DELETE subscription for model Trip
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onDelete(AppSyncClient.java:284)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda17.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/System.err(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987): An error occurred on the remote ON_UPDATE subscription for model TripSample
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onUpdate(AppSyncClient.java:266)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda18.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/System.err(16987):    at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/System.err(16987):    at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/System.err(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/System.err(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/System.err(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/System.err(16987):    at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/System.err(16987):    at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/System.err(16987):    at com.amplifyframework.datastore.appsync.AppSyncClient.onCreate(AppSyncClient.java:248)
W/System.err(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda16.subscribe(Unknown Source:7)
W/System.err(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/System.err(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/System.err(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/System.err(16987):    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/System.err(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/System.err(16987):    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987): An error occurred on the remote ON_UPDATE subscription for model Trip
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onUpdate(AppSyncClient.java:266)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda18.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/System.err(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/System.err(16987):    at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/System.err(16987):    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/System.err(16987):    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/System.err(16987):    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987): Reading subscription events has failed.
W/amplify:aws-datastore(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onDelete(AppSyncClient.java:284)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda17.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/System.err(16987):    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/System.err(16987):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/System.err(16987):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/System.err(16987):    at java.lang.Thread.run(Thread.java:1012)
W/System.err(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
W/System.err(16987):    at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
W/System.err(16987):    at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
W/System.err(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/System.err(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/System.err(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/System.err(16987):    at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/System.err(16987):    at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/System.err(16987):    at com.amplifyframework.datastore.appsync.AppSyncClient.onUpdate(AppSyncClient.java:266)
W/System.err(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda18.subscribe(Unknown Source:7)
W/System.err(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/System.err(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/System.err(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987): API sync failed - transitioning to LOCAL_ONLY.
W/amplify:aws-datastore(16987): DataStoreException{message=Error during subscription., cause=ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$2(AppSyncClient.java:322)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:324)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onUpdate(AppSyncClient.java:266)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda18.subscribe(Unknown Source:7)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(16987): Caused by: ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:73)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:87)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getAuthToken(AuthRuleRequestDecorator.java:226)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getIdentityValue(AuthRuleRequestDecorator.java:152)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:121)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
W/amplify:aws-datastore(16987):     ... 20 more
W/amplify:aws-datastore(16987): Caused by: java.lang.InterruptedException
W/amplify:aws-datastore(16987):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1048)
W/amplify:aws-datastore(16987):     at java.util.concurrent.Semaphore.acquire(Semaphore.java:318)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:71)
W/amplify:aws-datastore(16987):     ... 26 more
W/System.err(16987):    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
W/amplify:aws-datastore(16987): API sync failed - transitioning to LOCAL_ONLY.
W/amplify:aws-datastore(16987): DataStoreException{message=Error during subscription., cause=ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$2(AppSyncClient.java:322)
W/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$1$com-amplifyframework-api-aws-SubscriptionOperation(SubscriptionOperation.java:88)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionOperation$$ExternalSyntheticLambda0.accept(Unknown Source:4)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:146)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionOperation.lambda$start$2$com-amplifyframework-api-aws-SubscriptionOperation(SubscriptionOperation.java:78)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionOperation$$ExternalSyntheticLambda3.run(Unknown Source:2)
W/amplify:aws-datastore(16987):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
W/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
W/amplify:aws-datastore(16987): Caused by: ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:73)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:87)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionAuthorizer.forCognitoUserPools(SubscriptionAuthorizer.java:150)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionAuthorizer.createHeaders(SubscriptionAuthorizer.java:99)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionAuthorizer.createHeadersForConnection(SubscriptionAuthorizer.java:74)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionEndpoint.buildConnectionRequestUrl(SubscriptionEndpoint.java:324)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(SubscriptionEndpoint.java:141)
W/amplify:aws-datastore(16987):     ... 7 more
W/amplify:aws-datastore(16987): Caused by: java.lang.InterruptedException
W/amplify:aws-datastore(16987):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1048)
W/amplify:aws-datastore(16987):     at java.util.concurrent.Semaphore.acquire(Semaphore.java:318)
W/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:71)
W/amplify:aws-datastore(16987):     ... 13 more
I/amplify:aws-datastore(16987): Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY
E/amplify:aws-datastore(16987): Failure encountered while attempting to start API sync.
E/amplify:aws-datastore(16987): DataStoreException{message=DataStore subscriptionProcessor failed to start., cause=DataStoreException{message=Error during subscription., cause=ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}, recoverySuggestion=Check your internet.}
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.Orchestrator.lambda$startApiSync$4$com-amplifyframework-datastore-syncengine-Orchestrator(Orchestrator.java:344)
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.Orchestrator$$ExternalSyntheticLambda8.subscribe(Unknown Source:2)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.subscribeActual(CompletableCreate.java:40)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.completable.CompletablePeek.subscribeActual(CompletablePeek.java:51)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Completable.subscribe(Completable.java:2850)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
E/amplify:aws-datastore(16987):     at java.util.concurrent.FutureTask.run(FutureTask.java:264)
E/amplify:aws-datastore(16987):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
E/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/amplify:aws-datastore(16987):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/amplify:aws-datastore(16987):     at java.lang.Thread.run(Thread.java:1012)
E/amplify:aws-datastore(16987): Caused by: DataStoreException{message=Error during subscription., cause=ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}, recoverySuggestion=Evaluate details.}
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.lambda$subscription$2(AppSyncClient.java:322)
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient$$ExternalSyntheticLambda1.accept(Unknown Source:4)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:324)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.appsync.AppSyncClient.onUpdate(AppSyncClient.java:266)
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda18.subscribe(Unknown Source:7)
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
E/amplify:aws-datastore(16987):     at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
I/amplify:aws-datastore(16987): Stopping subscription processor.
I/amplify:aws-datastore(16987): Stopped subscription processor.
I/amplify:aws-datastore(16987): Setting currentState to LOCAL_ONLY
W/System.err(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
W/System.err(16987):    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
E/AndroidRuntime(16987): FATAL EXCEPTION: RxCachedThreadScheduler-8
E/AndroidRuntime(16987): Process: PID: 16987
E/AndroidRuntime(16987): java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
E/AndroidRuntime(16987):    at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.isReadRestrictingStaticGroup(AuthRuleRequestDecorator.java:145)
E/AndroidRuntime(16987):    at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:101)
E/AndroidRuntime(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
E/AndroidRuntime(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
E/AndroidRuntime(16987):    at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:295)
E/AndroidRuntime(16987):    at com.amplifyframework.api.ApiCategory.subscribe(ApiCategory.java:91)
E/AndroidRuntime(16987):    at com.amplifyframework.datastore.appsync.AppSyncClient.subscription(AppSyncClient.java:326)
E/AndroidRuntime(16987):    at com.amplifyframework.datastore.appsync.AppSyncClient.onCreate(AppSyncClient.java:248)
E/AndroidRuntime(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda16.subscribe(Unknown Source:7)
E/AndroidRuntime(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor.lambda$subscriptionObservable$6$com-amplifyframework-datastore-syncengine-SubscriptionProcessor(SubscriptionProcessor.java:190)
E/AndroidRuntime(16987):    at com.amplifyframework.datastore.syncengine.SubscriptionProcessor$$ExternalSyntheticLambda19.subscribe(Unknown Source:11)
E/AndroidRuntime(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
E/AndroidRuntime(16987):    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
E/AndroidRuntime(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableDoOnEach.subscribeActual(ObservableDoOnEach.java:42)
E/AndroidRuntime(16987):    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
E/AndroidRuntime(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
E/AndroidRuntime(16987):    at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
E/AndroidRuntime(16987):    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
E/AndroidRuntime(16987):    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
E/AndroidRuntime(16987):    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
E/AndroidRuntime(16987):    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
E/AndroidRuntime(16987):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/AndroidRuntime(16987):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/AndroidRuntime(16987):    at java.lang.Thread.run(Thread.java:1012)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
E/amplify:aws-datastore(16987):     at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
E/amplify:aws-datastore(16987):     ... 8 more
E/amplify:aws-datastore(16987): Caused by: ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don't have a suggested fix for this error yet.}
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:73)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.getLatestAuthToken(DefaultCognitoUserPoolsAuthProvider.java:87)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getAuthToken(AuthRuleRequestDecorator.java:226)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.getIdentityValue(AuthRuleRequestDecorator.java:152)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.auth.AuthRuleRequestDecorator.decorate(AuthRuleRequestDecorator.java:121)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.buildSubscriptionOperation(AWSApiPlugin.java:635)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.AWSApiPlugin.subscribe(AWSApiPlugin.java:315)
E/amplify:aws-datastore(16987):     ... 20 more
E/amplify:aws-datastore(16987): Caused by: java.lang.InterruptedException
E/amplify:aws-datastore(16987):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1048)
E/amplify:aws-datastore(16987):     at java.util.concurrent.Semaphore.acquire(Semaphore.java:318)
E/amplify:aws-datastore(16987):     at com.amplifyframework.api.aws.sigv4.DefaultCognitoUserPoolsAuthProvider.fetchToken(DefaultCognitoUserPoolsAuthProvider.java:71)
E/amplify:aws-datastore(16987):     ... 26 more
W/System.err(16987):    at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
W/System.err(16987):    at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
W/System.err(16987):    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
W/System.err(16987):    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
W/System.err(16987):    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
W/System.err(16987):    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
W/System.err(16987):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/System.err(16987):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/System.err(16987):    at java.lang.Thread.run(Thread.java:1012)
I/Process (16987): Sending signal. PID: 16987 SIG: 9
Lost connection to device.
Exited

I have cleaned the build, run amplify codegen models and deployed to a brand new backend just to make sure this wasn't due to a previous schema change. This crash occurs every time on Android. If I turn off wifi on the test device (Google Pixel 5), the app seems to run fine with a local datastore copy. The moment I let this app try and sync with my backend I get the above crash.

I can simply swap the android device for an iOS device and this runs without error. I have an iOS app released and it has been working fine for months.

Thanks in advance. Let me know if I should create a separate issue for this.

tylerjroach commented 11 months ago

Hi @tedevel, I'm on the native Amplify Android team. Dynamic group auth such as { allow: groups, groupsField: "ownerID", operations: [read] } is not supported on Android. After speaking with the Swift team on this, I don't think it is supported on Swift as well. While it may not be crashing as Android does, I'm not sure it is working as expected.

thomasklaush commented 11 months ago

@tedevel so the documentation is wrong? Datastore works currently only for iOS and Android. In the section data modelling, this is mentioned there directly https://docs.amplify.aws/flutter/build-a-backend/graphqlapi/customize-authorization-rules/#user-group-based-data-access

# Dynamic group authorization with multiple groups
type Post @model @auth(rules: [{ allow: groups, groupsField: "groups" }]) {
  id: ID!
  title: String
  groups: [String]
}

# Dynamic group authorization with a single group
type Post @model @auth(rules: [{ allow: groups, groupsField: "group" }]) {
  id: ID!
  title: String
  group: String
}
haverchuck commented 11 months ago

@thomasklaush Those auth rules should work when using the API GraphQL category (the documentation you cited) outside of Datastore. They are not supported in DataStore because of a limitation related to real time subscriptions.

thomasklaush commented 11 months ago

@haverchuck thanks for the info.

Should be mentioned in the documentation for Datastore.

thomasklaush commented 11 months ago

Just to recap, the solution is to remove the AUTH for dynamic groups mapping and maybe add an Index instead to use it with groups.

Occurring risk is, that in case of a bug, wrong users can change and add at wrong groups. So has to be considered in the App logic ant tested.

dgagnon commented 11 months ago

@haverchuck thanks for the info.

Should be mentioned in the documentation for Datastore.

It is already: https://docs.amplify.aws/flutter/build-a-backend/more-features/datastore/authz-rules-setup/

dgagnon commented 11 months ago

Occurring risk is, that in case of a bug, wrong users can change and add at wrong groups. So has to be considered in the App logic ant tested.

Maybe I misunderstood your comment, but if you manually handle it, nothing stops a user from updating the group field themselves.

thomasklaush commented 11 months ago

I have two applications. The one which can change the data, will find only the data with the right group. If I don't show them accidentally the wrong data, they cannot change. But yes, I have to be carefully.

Jordan-Nelson commented 10 months ago

@thomasklaush - Let us know if you are still facing an issue or have additional questions. Thanks.

thomasklaush commented 10 months ago

@Jordan-Nelson solved. Root cause was the limitation of datastore in terms of the dynamic group authentication and the limitation of myself reading documentation carefully :-)

Jordan-Nelson commented 10 months ago

Glad to hear it is resolved. I will close this issue out.