aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

DataStore: Conflict handler doesn't run when a non-nullable @belongsTo field exists and Optimistic Concurrency is used #10487

Open duckbytes opened 2 years ago

duckbytes commented 2 years ago

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

GraphQL API, DataStore

Amplify Categories

api

Environment information

``` System: OS: Linux 6.0 Arch Linux CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor Memory: 2.68 GB / 31.26 GB Container: Yes Shell: 5.9 - /bin/zsh Binaries: Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node Yarn: 1.22.19 - /usr/bin/yarn npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm Browsers: Firefox: 105.0.3 npmPackages: @aws-amplify/ui-react: ^3.5.8 => 3.5.8 @aws-amplify/ui-react-internal: undefined () @aws-amplify/ui-react-legacy: undefined () @testing-library/jest-dom: ^5.16.5 => 5.16.5 @testing-library/react: ^13.4.0 => 13.4.0 @testing-library/user-event: ^13.5.0 => 13.5.0 aws-amplify: ^4.3.39 => 4.3.39 react: ^18.2.0 => 18.2.0 (18.1.0) react-dom: ^18.2.0 => 18.2.0 react-scripts: 5.0.1 => 5.0.1 web-vitals: ^2.1.4 => 2.1.4 npmGlobalPackages: @aws-amplify/cli: 8.0.3 cordova: 11.0.0 corepack: 0.10.0 create-react-native-app: 3.8.0 deadfile: 2.0.1 npm: 8.1.2 react-js-to-ts: 1.4.0 ts-node: 10.9.1 typescript: 4.8.2 ```

Describe the bug

When a one to many relation is added to the schema that is non-nullable, the DataStore conflict handler does not run. The console prints a number of warnings:

[WARN] 42:54.51 DataStore - conflict trycatch TypeError: Invalid value used in weak set

The network tab also shows multiple attempts at making the mutation with the same ConflictUnhandled response:

{"data":{"updateTodo":null},"errors":[{"path":["updateTodo"],"data":null,"errorType":"ConflictUnhandled","errorInfo":null,"locations":[{"line":2,"column":3,"sourceName":null}],"message":"Conflict resolver rejects mutation."}]}

This mutation is attempted 11 times. The warning is printed on the console 10 times.

image

The conflict handler function set in DataStore.configure does not run.

If relation is nullable, the conflict handler does run and those warnings are not printed. There is also only one mutation attempt made and not 11.

It only seems to be affected when there are non-nullable relations and not non-nullable single fields.

Expected behavior

I would expect the conflict handler to always run whether fields are nullable or non-nullable.

Reproduction steps

amplify init amplify add api

Enable conflict resolution and choose Optimistic Concurrency.

Create a schema with a model with one non-nullable field with @belongsTo directive. Create a corresponding @hasMany field on the target model.

amplify codegen models amplify push npm start

Open the app in one window and add some data. Open it in another window and go to dev tools > network (Chrome).

Set throttling to Offline. Make some changes to a record. Make changes to another field on the first browser window. Set throttling to No throttling.

Look for console.log from the conflict handler running. Look for warnings printed in the console.

To make the conflict handler run again, make the @belongsTo field nullable and run:

amplify codegen models amplify push

Code Snippet

App.js

import React from "react";
import Amplify, { DataStore } from "aws-amplify";
import { Todo, User } from "./models";
import { DISCARD } from "@aws-amplify/datastore";

const config = require("../src/aws-exports");
Amplify.configure({
  ...config.default,
});

DataStore.configure({
  conflictHandler: ({ modelConstructor, remoteModel, localModel }) => {
    console.log(
      "DataStore has found a conflict",
      modelConstructor,
      remoteModel,
      localModel
    );
    return DISCARD;
  },
});

const convertToOject = (array) => {
  const obj = {};
  array.forEach((item) => {
    obj[item.id] = item;
  });
  return obj;
};

function App() {
  const [whoami, setWhoami] = React.useState(null);
  const [todos, setTodos] = React.useState({});

  const addWhoami = async () => {
    const users = await DataStore.query(User);
    if (users.length > 0) {
      setWhoami(users[0]);
    } else {
      const newWhoami = await DataStore.save(new User({}));
      setWhoami(newWhoami);
    }
  };

  React.useEffect(() => {
    addWhoami();
  }, []);

  React.useEffect(() => {
    DataStore.observeQuery(Todo).subscribe(({ items }) => {
      setTodos(convertToOject(items));
    });
  }, []);

  const handleUpdateTodo = async (data) => {
    const todo = await DataStore.query(Todo, data.id);
    await DataStore.save(
      Todo.copyOf(todo, (updated) => {
        updated.name = data.name;
        updated.description = data.description;
      })
    );
  };

  const handleChangeTodo = (todoId, data, key) => {
    const todo = todos[todoId];
    setTodos({ ...todos, [todoId]: { ...todo, [key]: data } });
  };

  const handleAddTodo = async () => {
    await DataStore.save(
      new Todo({
        createdBy: whoami,
        name: "",
        description: "",
        complete: false,
      })
    );
  };
  return (
    <div>
      {Object.values(todos).map((todo) => (
        <form key={todo.id}>
          <label>
            Name:
            <input
              value={todo.name}
              onChange={(e) =>
                handleChangeTodo(todo.id, e.target.value, "name")
              }
              type="text"
              name="name"
            />
          </label>
          <label>
            Description:
            <input
              value={todo.description}
              onChange={(e) =>
                handleChangeTodo(todo.id, e.target.value, "description")
              }
              type="text"
              name="description"
            />
          </label>
          <input
            onClick={() => handleUpdateTodo(todos[todo.id])}
            type="button"
            value="Save"
          />
        </form>
      ))}
      <input onClick={handleAddTodo} type="submit" value="Add todo" />
    </div>
  );
}

export default App;

schema.graphql

input AMPLIFY { globalAuthRule: AuthRule = { allow: public } } # FOR TESTING ONLY!

type Todo
@model {
  id: ID!
  createdBy: User! @belongsTo
  name: String!
  description: String
}

type User @model {
  id: ID!
  todos: [Todo] @hasMany
}

Log output

``` ConsoleLogger.ts:125 [DEBUG] 59:19.81 Hub - Dispatching to datastore with {event: 'networkStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:19.106 Hub - Dispatching to datastore with {event: 'networkStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:19.106 Hub - Dispatching to datastore with {event: 'networkStatus', data: {…}} ConsoleLogger.ts:115 [DEBUG] 59:20.107 AWSAppSyncRealTimeProvider - closing WebSocket... ConsoleLogger.ts:125 [DEBUG] 59:20.967 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ConsoleLogger.ts:125 [DEBUG] 59:20.990 Hub - Dispatching to datastore with {event: 'outboxMutationEnqueued', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:20.990 Hub - Dispatching to datastore with {event: 'outboxMutationEnqueued', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:20.990 Hub - Dispatching to datastore with {event: 'outboxMutationEnqueued', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:20.990 Hub - Dispatching to datastore with {event: 'outboxStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:20.991 Hub - Dispatching to datastore with {event: 'outboxStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:20.991 Hub - Dispatching to datastore with {event: 'outboxStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:20.991 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ConsoleLogger.ts:125 [DEBUG] 59:20.991 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ConsoleLogger.ts:125 [DEBUG] 59:20.992 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ConsoleLogger.ts:125 [DEBUG] 59:29.597 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ConsoleLogger.ts:125 [DEBUG] 59:32.553 Hub - Dispatching to datastore with {event: 'networkStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.553 Hub - Dispatching to datastore with {event: 'networkStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.553 Hub - Dispatching to datastore with {event: 'networkStatus', data: {…}} ConsoleLogger.ts:115 [DEBUG] 59:32.553 AuthClass - getting current credentials ConsoleLogger.ts:115 [DEBUG] 59:32.554 Credentials - getting credentials ConsoleLogger.ts:115 [DEBUG] 59:32.554 Credentials - picking up credentials ConsoleLogger.ts:115 [DEBUG] 59:32.554 Credentials - getting new cred promise ConsoleLogger.ts:115 [DEBUG] 59:32.554 Credentials - checking if credentials exists and not expired ConsoleLogger.ts:125 [DEBUG] 59:32.554 Credentials - are these credentials expired? {accessKeyId: 'ASIAR4SDEN72FMEHKJXA', secretAccessKey: 'cTdc47FLqfHeawyC2g+uCrTjOcSchHRcBS5skN6P', sessionToken: 'IQoJb3JpZ2luX2VjECUaCWV1LXdlc3QtMSJGMEQCIDWKMNr+uu…oMZquFO3ITsNvlOYMqjOqg9lwv8Dw0DFeMVX0zboeHrlH3z94', expiration: Sun Oct 16 2022 14:51:34 GMT+0100 (British Summer Time), identityId: 'eu-west-1:8e90534a-1c44-4928-9e95-e3210f518115', …} ConsoleLogger.ts:115 [DEBUG] 59:32.555 Credentials - credentials not changed and not expired, directly return ConsoleLogger.ts:115 [DEBUG] 59:32.555 AuthClass - Getting current session ConsoleLogger.ts:125 [DEBUG] 59:32.555 AuthClass - Getting the session from this user: CognitoUser {username: 'theo', pool: CognitoUserPool, Session: null, client: Client, signInUserSession: CognitoUserSession, …} ConsoleLogger.ts:125 [DEBUG] 59:32.555 AuthClass - Succeed to get the user session CognitoUserSession {idToken: CognitoIdToken, refreshToken: CognitoRefreshToken, accessToken: CognitoAccessToken, clockDrift: 0} ConsoleLogger.ts:115 [INFO] 59:32.556 Cache - Get item: key is federatedInfo with options undefined ConsoleLogger.ts:115 [DEBUG] 59:32.556 AuthClass - getting current authenticated user ConsoleLogger.ts:115 [DEBUG] 59:32.556 AuthClass - get current authenticated userpool user ConsoleLogger.ts:115 [INFO] 59:32.557 DataStore - Realtime ready ConsoleLogger.ts:125 [DEBUG] 59:32.557 Hub - Dispatching to datastore with {event: 'subscriptionsEstablished', data: undefined} ConsoleLogger.ts:125 [DEBUG] 59:32.557 Hub - Dispatching to datastore with {event: 'subscriptionsEstablished', data: undefined} ConsoleLogger.ts:125 [DEBUG] 59:32.557 Hub - Dispatching to datastore with {event: 'subscriptionsEstablished', data: undefined} ConsoleLogger.ts:115 [DEBUG] 59:32.558 DataStore - Attempting Create subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 59:32.558 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-fsv5r66ve5a7hp7meau5loecwe', query: 'subscription operation {\n onCreateTodo {\n id\n … createdBy {\n id\n _deleted\n }\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 59:32.559 AWSAppSyncRealTimeProvider - Authenticating with API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.559 DataStore - Attempting Update subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 59:32.559 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-fsv5r66ve5a7hp7meau5loecwe', query: 'subscription operation {\n onUpdateTodo {\n id\n … createdBy {\n id\n _deleted\n }\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 59:32.560 AWSAppSyncRealTimeProvider - Authenticating with API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.560 DataStore - Attempting Delete subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 59:32.560 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-fsv5r66ve5a7hp7meau5loecwe', query: 'subscription operation {\n onDeleteTodo {\n id\n … createdBy {\n id\n _deleted\n }\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 59:32.560 AWSAppSyncRealTimeProvider - Authenticating with API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.561 DataStore - Attempting Create subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 59:32.561 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-fsv5r66ve5a7hp7meau5loecwe', query: 'subscription operation {\n onCreateUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 59:32.561 AWSAppSyncRealTimeProvider - Authenticating with API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.561 DataStore - Attempting Update subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 59:32.562 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-fsv5r66ve5a7hp7meau5loecwe', query: 'subscription operation {\n onUpdateUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 59:32.562 AWSAppSyncRealTimeProvider - Authenticating with API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.562 DataStore - Attempting Delete subscription with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 59:32.562 PubSub - subscribe options {provider: Symbol(INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER), appSyncGraphqlEndpoint: 'https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql', authenticationType: 'API_KEY', apiKey: 'da2-fsv5r66ve5a7hp7meau5loecwe', query: 'subscription operation {\n onDeleteUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', …} ConsoleLogger.ts:115 [DEBUG] 59:32.563 AWSAppSyncRealTimeProvider - Authenticating with API_KEY ConsoleLogger.ts:125 [DEBUG] 59:32.563 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connecting'} ConsoleLogger.ts:125 [DEBUG] 59:32.564 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connecting'} ConsoleLogger.ts:125 [DEBUG] 59:32.564 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connecting'} ConsoleLogger.ts:125 [DEBUG] 59:32.564 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connecting'} ConsoleLogger.ts:125 [DEBUG] 59:32.564 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connecting'} ConsoleLogger.ts:125 [DEBUG] 59:32.565 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connecting'} ConsoleLogger.ts:115 [DEBUG] 59:32.565 AWSAppSyncRealTimeProvider - Authenticating with API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.565 AWSAppSyncRealTimeProvider - Initializaling retryable Handshake ConsoleLogger.ts:115 [DEBUG] 59:32.566 Util - bound attempt #1 with this vars: ["wss://paiikeh2znggrngbcyz3besbsq.appsync-realtime-api.eu-west-1.amazonaws.com/graphql?header=eyJob3N0IjoicGFpaWtlaDJ6bmdncm5nYmN5ejNiZXNic3EuYXBwc3luYy1hcGkuZXUtd2VzdC0xLmFtYXpvbmF3cy5jb20iLCJ4LWFtei1kYXRlIjoiMjAyMjEwMTZUMTI1OTMyWiIsIngtYXBpLWtleSI6ImRhMi1mc3Y1cjY2dmU1YTdocDdtZWF1NWxvZWN3ZSJ9&payload=e30="] ConsoleLogger.ts:115 [DEBUG] 59:32.566 AWSAppSyncRealTimeProvider - Initializing handshake wss://paiikeh2znggrngbcyz3besbsq.appsync-realtime-api.eu-west-1.amazonaws.com/graphql?header=eyJob3N0IjoicGFpaWtlaDJ6bmdncm5nYmN5ejNiZXNic3EuYXBwc3luYy1hcGkuZXUtd2VzdC0xLmFtYXpvbmF3cy5jb20iLCJ4LWFtei1kYXRlIjoiMjAyMjEwMTZUMTI1OTMyWiIsIngtYXBpLWtleSI6ImRhMi1mc3Y1cjY2dmU1YTdocDdtZWF1NWxvZWN3ZSJ9&payload=e30= ConsoleLogger.ts:125 [DEBUG] 59:32.567 Hub - Dispatching to datastore with {event: 'syncQueriesStarted', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.567 Hub - Dispatching to datastore with {event: 'syncQueriesStarted', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.568 Hub - Dispatching to datastore with {event: 'syncQueriesStarted', data: {…}} ConsoleLogger.ts:115 [DEBUG] 59:32.568 DataStore - Attempting sync with authMode: API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.568 Util - attempt #1 with this vars: ["query operation($limit: Int, $nextToken: String, $lastSync: AWSTimestamp, $filter: ModelUserFilterInput){\n\t\tsyncUsers(limit: $limit, nextToken: $nextToken, lastSync: $lastSync, filter: $filter){\n\t\t\titems {\n\t\t\t\t\t\t\tid\ncreatedAt\nupdatedAt\n_version\n_lastChangedAt\n_deleted\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextToken\n\t\t\t\t\t\tstartedAt\n\t\t}\n\t}",{"limit":1000,"nextToken":null,"lastSync":1665925003962,"filter":null}] ConsoleLogger.ts:125 [DEBUG] 59:32.569 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:115 [DEBUG] 59:32.713 DataStore - Sync successful with authMode: API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.714 DataStore - Attempting sync with authMode: API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.714 Util - attempt #1 with this vars: ["query operation($limit: Int, $nextToken: String, $lastSync: AWSTimestamp, $filter: ModelTodoFilterInput){\n\t\tsyncTodos(limit: $limit, nextToken: $nextToken, lastSync: $lastSync, filter: $filter){\n\t\t\titems {\n\t\t\t\t\t\t\tid\nname\ndescription\ncreatedAt\nupdatedAt\n_version\n_lastChangedAt\n_deleted\ncreatedBy { id _deleted }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextToken\n\t\t\t\t\t\tstartedAt\n\t\t}\n\t}",{"limit":1000,"nextToken":null,"lastSync":1665925004091,"filter":null}] ConsoleLogger.ts:125 [DEBUG] 59:32.715 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [DEBUG] 59:32.729 Hub - Dispatching to datastore with {event: 'modelSynced', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.729 Hub - Dispatching to datastore with {event: 'modelSynced', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.729 Hub - Dispatching to datastore with {event: 'modelSynced', data: {…}} ConsoleLogger.ts:115 [DEBUG] 59:32.888 DataStore - Sync successful with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 59:32.911 Hub - Dispatching to datastore with {event: 'modelSynced', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.911 Hub - Dispatching to datastore with {event: 'modelSynced', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.912 Hub - Dispatching to datastore with {event: 'modelSynced', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:32.912 Hub - Dispatching to datastore with {event: 'syncQueriesReady', data: undefined} ConsoleLogger.ts:125 [DEBUG] 59:32.912 Hub - Dispatching to datastore with {event: 'syncQueriesReady', data: undefined} ConsoleLogger.ts:125 [DEBUG] 59:32.912 Hub - Dispatching to datastore with {event: 'syncQueriesReady', data: undefined} ConsoleLogger.ts:115 [DEBUG] 59:32.912 DataStore - Next fullSync in 85356.086 seconds. (Mon Oct 17 2022 13:42:08 GMT+0100 (British Summer Time)) ConsoleLogger.ts:115 [DEBUG] 59:32.914 DataStore - Attempting mutation with authMode: API_KEY ConsoleLogger.ts:115 [DEBUG] 59:32.914 Util - attempt #1 with this vars: ["Todo","Update","{\"description\":\"eeeff\",\"id\":\"c36b9c9e-9dbe-4d12-9f99-f079a4fbc55c\",\"_version\":6,\"_lastChangedAt\":1665925002479,\"_deleted\":null}","{}",null,null,{"data":"{\"description\":\"eeeff\",\"id\":\"c36b9c9e-9dbe-4d12-9f99-f079a4fbc55c\",\"_version\":6,\"_lastChangedAt\":1665925002479,\"_deleted\":null}","modelId":"c36b9c9e-9dbe-4d12-9f99-f079a4fbc55c","model":"Todo","operation":"Update","condition":"{}","id":"01GFGDK0E6TYXK98TXQKMATAZG"}] ConsoleLogger.ts:125 [DEBUG] 59:32.915 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:115 [DEBUG] 59:32.941 AWSAppSyncRealTimeProvider - subscription message from AWS AppSyncRealTime: {"type":"connection_ack","payload":{"connectionTimeoutMs":300000}} ConsoleLogger.ts:115 [DEBUG] 59:32.941 AWSAppSyncRealTimeProvider - Notifying connection successful ConsoleLogger.ts:115 [DEBUG] 59:32.941 AWSAppSyncRealTimeProvider - Notifying connection successful ConsoleLogger.ts:115 [DEBUG] 59:32.941 AWSAppSyncRealTimeProvider - Notifying connection successful ConsoleLogger.ts:115 [DEBUG] 59:32.941 AWSAppSyncRealTimeProvider - Notifying connection successful ConsoleLogger.ts:115 [DEBUG] 59:32.941 AWSAppSyncRealTimeProvider - Notifying connection successful ConsoleLogger.ts:115 [DEBUG] 59:32.941 AWSAppSyncRealTimeProvider - Notifying connection successful ConsoleLogger.ts:115 [DEBUG] 59:32.941 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"type":"ka"} ConsoleLogger.ts:118 [DEBUG] 59:32.942 AWSAppSyncRealTimeProvider {id: '', observer: null, query: '', variables: {…}} ConsoleLogger.ts:125 [WARN] 59:33.56 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:33.57 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:115 [DEBUG] 59:33.59 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"id":"8dc9de0b-5ebe-403b-aff6-3afbe2e93e1f","type":"start_ack"} ConsoleLogger.ts:118 [DEBUG] 59:33.59 AWSAppSyncRealTimeProvider {id: '8dc9de0b-5ebe-403b-aff6-3afbe2e93e1f', observer: SubscriptionObserver, query: 'subscription operation {\n onUpdateTodo {\n id\n … createdBy {\n id\n _deleted\n }\n }\n}\n', variables: {…}} ConsoleLogger.ts:115 [DEBUG] 59:33.59 AWSAppSyncRealTimeProvider - subscription ready for {"query":"subscription operation {\n onUpdateTodo {\n id\n name\n description\n createdAt\n updatedAt\n _version\n _lastChangedAt\n _deleted\n createdBy {\n id\n _deleted\n }\n }\n}\n","variables":{}} ConsoleLogger.ts:125 [DEBUG] 59:33.59 Hub - Dispatching to api with {event: 'Subscription ack', data: {…}, message: 'Connection established for subscription'} ConsoleLogger.ts:125 [DEBUG] 59:33.59 Hub - Dispatching to api with {event: 'Subscription ack', data: {…}, message: 'Connection established for subscription'} ConsoleLogger.ts:125 [DEBUG] 59:33.59 Hub - Dispatching to api with {event: 'Subscription ack', data: {…}, message: 'Connection established for subscription'} ConsoleLogger.ts:125 [DEBUG] 59:33.59 Hub - Dispatching to api with {event: 'Subscription ack', data: {…}, message: 'Connection established for subscription'} ConsoleLogger.ts:125 [DEBUG] 59:33.60 Hub - Dispatching to api with {event: 'Subscription ack', data: {…}, message: 'Connection established for subscription'} ConsoleLogger.ts:125 [DEBUG] 59:33.60 Hub - Dispatching to api with {event: 'Subscription ack', data: {…}, message: 'Connection established for subscription'} ConsoleLogger.ts:125 [DEBUG] 59:33.60 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connected'} ConsoleLogger.ts:125 [DEBUG] 59:33.60 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connected'} ConsoleLogger.ts:125 [DEBUG] 59:33.60 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connected'} ConsoleLogger.ts:125 [DEBUG] 59:33.60 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connected'} ConsoleLogger.ts:125 [DEBUG] 59:33.60 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connected'} ConsoleLogger.ts:125 [DEBUG] 59:33.60 Hub - Dispatching to api with {event: 'ConnectionStateChange', data: {…}, message: 'Connection state is Connected'} ConsoleLogger.ts:115 [DEBUG] 59:33.61 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"id":"a13df06b-ce94-4cef-b7d1-e2601de7e732","type":"start_ack"} ConsoleLogger.ts:118 [DEBUG] 59:33.61 AWSAppSyncRealTimeProvider {id: 'a13df06b-ce94-4cef-b7d1-e2601de7e732', observer: SubscriptionObserver, query: 'subscription operation {\n onDeleteTodo {\n id\n … createdBy {\n id\n _deleted\n }\n }\n}\n', variables: {…}} ConsoleLogger.ts:115 [DEBUG] 59:33.61 AWSAppSyncRealTimeProvider - subscription ready for {"query":"subscription operation {\n onDeleteTodo {\n id\n name\n description\n createdAt\n updatedAt\n _version\n _lastChangedAt\n _deleted\n createdBy {\n id\n _deleted\n }\n }\n}\n","variables":{}} ConsoleLogger.ts:115 [DEBUG] 59:33.61 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"id":"629a66b1-252a-4228-8427-01fea7b0302d","type":"start_ack"} ConsoleLogger.ts:118 [DEBUG] 59:33.61 AWSAppSyncRealTimeProvider {id: '629a66b1-252a-4228-8427-01fea7b0302d', observer: SubscriptionObserver, query: 'subscription operation {\n onCreateUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', variables: {…}} ConsoleLogger.ts:115 [DEBUG] 59:33.62 AWSAppSyncRealTimeProvider - subscription ready for {"query":"subscription operation {\n onCreateUser {\n id\n createdAt\n updatedAt\n _version\n _lastChangedAt\n _deleted\n }\n}\n","variables":{}} ConsoleLogger.ts:115 [DEBUG] 59:33.64 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"id":"24ed76cf-69b6-4e1e-ad07-be854be2dfbe","type":"start_ack"} ConsoleLogger.ts:118 [DEBUG] 59:33.64 AWSAppSyncRealTimeProvider {id: '24ed76cf-69b6-4e1e-ad07-be854be2dfbe', observer: SubscriptionObserver, query: 'subscription operation {\n onUpdateUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', variables: {…}} ConsoleLogger.ts:115 [DEBUG] 59:33.64 AWSAppSyncRealTimeProvider - subscription ready for {"query":"subscription operation {\n onUpdateUser {\n id\n createdAt\n updatedAt\n _version\n _lastChangedAt\n _deleted\n }\n}\n","variables":{}} ConsoleLogger.ts:115 [DEBUG] 59:33.66 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"id":"3411d1d3-57eb-49a7-a8ec-4f5ecc00c07d","type":"start_ack"} ConsoleLogger.ts:118 [DEBUG] 59:33.66 AWSAppSyncRealTimeProvider {id: '3411d1d3-57eb-49a7-a8ec-4f5ecc00c07d', observer: SubscriptionObserver, query: 'subscription operation {\n onDeleteUser {\n id\n … _version\n _lastChangedAt\n _deleted\n }\n}\n', variables: {…}} ConsoleLogger.ts:115 [DEBUG] 59:33.66 AWSAppSyncRealTimeProvider - subscription ready for {"query":"subscription operation {\n onDeleteUser {\n id\n createdAt\n updatedAt\n _version\n _lastChangedAt\n _deleted\n }\n}\n","variables":{}} ConsoleLogger.ts:115 [DEBUG] 59:33.66 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"id":"64e80d27-e8f4-4234-9ae3-a9883ebf0f8a","type":"start_ack"} ConsoleLogger.ts:118 [DEBUG] 59:33.66 AWSAppSyncRealTimeProvider {id: '64e80d27-e8f4-4234-9ae3-a9883ebf0f8a', observer: SubscriptionObserver, query: 'subscription operation {\n onCreateTodo {\n id\n … createdBy {\n id\n _deleted\n }\n }\n}\n', variables: {…}} ConsoleLogger.ts:115 [DEBUG] 59:33.66 AWSAppSyncRealTimeProvider - subscription ready for {"query":"subscription operation {\n onCreateTodo {\n id\n name\n description\n createdAt\n updatedAt\n _version\n _lastChangedAt\n _deleted\n createdBy {\n id\n _deleted\n }\n }\n}\n","variables":{}} ConsoleLogger.ts:125 [WARN] 59:33.192 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:33.193 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [WARN] 59:33.341 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:33.342 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [WARN] 59:33.465 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:33.465 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [WARN] 59:33.624 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:33.625 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [WARN] 59:33.778 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:33.779 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [WARN] 59:33.894 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:33.895 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [WARN] 59:34.70 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:34.72 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [WARN] 59:34.196 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:34.196 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [WARN] 59:34.327 DataStore - conflict trycatch TypeError: Invalid value used in weak set at WeakSet.add () at MutationProcessor.modelInstanceCreator (datastore.ts:294:1) at MutationProcessor. (mutation.ts:332:1) at step (errorMaps.ts:93:1) at Object.throw (errorMaps.ts:93:1) at rejected (errorMaps.ts:93:1) ConsoleLogger._log @ ConsoleLogger.ts:125 ConsoleLogger.warn @ ConsoleLogger.ts:164 (anonymous) @ mutation.ts:340 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 rejected @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 (anonymous) @ mutation.ts:264 (anonymous) @ Retry.ts:37 step @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 (anonymous) @ Reachability.ts:8 __awaiter @ Reachability.ts:8 retry @ Retry.ts:25 (anonymous) @ mutation.ts:256 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.jitteredRetry @ mutation.ts:243 (anonymous) @ mutation.ts:168 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 authModeRetry_1 @ mutation.ts:163 (anonymous) @ mutation.ts:206 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 fulfilled @ errorMaps.ts:93 Promise.then (async) step @ errorMaps.ts:93 (anonymous) @ errorMaps.ts:93 __awaiter @ errorMaps.ts:93 MutationProcessor.resume @ mutation.ts:131 (anonymous) @ mutation.ts:121 Subscription @ Observable.js:197 subscribe @ Observable.js:279 (anonymous) @ index.ts:297 step @ index.ts:3 (anonymous) @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 fulfilled @ index.ts:3 Promise.then (async) step @ index.ts:3 (anonymous) @ index.ts:3 __awaiter @ index.ts:3 (anonymous) @ index.ts:199 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 (anonymous) @ datastoreConnectivity.ts:38 notifySubscription @ Observable.js:135 onNotify @ Observable.js:179 next @ Observable.js:235 notifyOnline @ Reachability.ts:23 ConsoleLogger.ts:125 [DEBUG] 59:34.327 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:125 [DEBUG] 59:34.448 RestClient - POST https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql ConsoleLogger.ts:115 [DEBUG] 59:34.568 DataStore - Mutation sent successfully with authMode: API_KEY ConsoleLogger.ts:125 [DEBUG] 59:34.589 Hub - Dispatching to datastore with {event: 'outboxMutationProcessed', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:34.589 Hub - Dispatching to datastore with {event: 'outboxMutationProcessed', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:34.589 Hub - Dispatching to datastore with {event: 'outboxMutationProcessed', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:34.589 Hub - Dispatching to datastore with {event: 'outboxStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:34.590 Hub - Dispatching to datastore with {event: 'outboxStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:34.590 Hub - Dispatching to datastore with {event: 'outboxStatus', data: {…}} ConsoleLogger.ts:125 [DEBUG] 59:34.602 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ConsoleLogger.ts:125 [DEBUG] 59:34.603 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ConsoleLogger.ts:125 [DEBUG] 59:34.603 DataStore - params ready {predicate: {…}, pagination: {…}, modelConstructor: ƒ} ```

aws-exports.js

/* eslint-disable */
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.

const awsmobile = {
    "aws_project_region": "eu-west-1",
    "aws_appsync_graphqlEndpoint": "https://paiikeh2znggrngbcyz3besbsq.appsync-api.eu-west-1.amazonaws.com/graphql",
    "aws_appsync_region": "eu-west-1",
    "aws_appsync_authenticationType": "API_KEY",
    "aws_appsync_apiKey": "da2-fsv5r66ve5a7hp7meau5loecwe",
    "aws_cognito_identity_pool_id": "eu-west-1:1db6b681-80d2-424c-a873-c5aba63ec214",
    "aws_cognito_region": "eu-west-1",
    "aws_user_pools_id": "eu-west-1_UswECoxOz",
    "aws_user_pools_web_client_id": "as29p8ht5oo5jo79a1r9laj86",
    "oauth": {},
    "aws_cognito_username_attributes": [],
    "aws_cognito_social_providers": [],
    "aws_cognito_signup_attributes": [
        "EMAIL"
    ],
    "aws_cognito_mfa_configuration": "OFF",
    "aws_cognito_mfa_types": [
        "SMS"
    ],
    "aws_cognito_password_protection_settings": {
        "passwordPolicyMinLength": 8,
        "passwordPolicyCharacters": []
    },
    "aws_cognito_verification_mechanisms": [
        "EMAIL"
    ]
};

export default awsmobile;

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

chrisbonifacio commented 2 years ago

Hey @duckbytes thanks for opening this issue. Can you confirm if you've been able to reproduce this using the reproduction steps on the fresh app you mentioned on Discord? (when the createdBy field is required). Can you confirm that you haven't configured a conflict resolution strategy override for that particular model? Selection sets or input shouldn't have an affect on optimistic concurrency.

Finally, can you run amplify diagnose --send-report and share the output identifier ID?

ncarvajalc commented 2 years ago

I can confirm the issue is reproducible following the steps described by @duckbytes. I'll look into possible causes of the issue.

duckbytes commented 2 years ago

Thanks @ncarvajalc for looking into it.

@chrisbonifacio sorry for the delay. Maybe not needed now but I generated a report for the reproduction: d6e5f7b6ca9c454ae146353bd5eba025

This is a report for my actual app where I first discovered the issue: c483e5370c77cedae471340404b9b9de but I've already updated that so createdBy is nullable to work around the issue. So it might not be as helpful.

I was able to reproduce this issue on both my main project and the fresh reproduction I was talking about.

I haven't configured any conflict resolution overrides for a particular model (didn't know that could be done! could be useful).

ncarvajalc commented 2 years ago

@duckbytes, I looked for the reason why this is happening and found the following:

First of all, I think the Amplify Docs are not clear in describing the behavior with a required @belongsTo relationship. Let me explain:

In the DataStore documentation there is a relationships tutorial which shows an updated schema to show relationships. From the model it is inferred that Comment needs to be associated with a Post to be created. Nevertheless, this is not the behavior that is taking place.

Using the following model as an example (the one that you are having the issue with), we can see that a Todo needs to have a User to be created:

type Todo @model {
  id: ID!
  createdBy: User! @belongsTo
  name: String!
  description: String
}

type User @model {
  id: ID!
  todos: [Todo] @hasMany
}

When the API is created and we want to create a Todo, look what happens: Pasted image 20221024132914 It shouldn't be possible to create a Todo without a user. Also, look that the relationship is not mandatory in the explorer: Pasted image 20221024133120

The same behavior is not consistent with the @hasOne directive.

Now let's look at this model:

type Todo @model {
  id: ID!
  createdBy: User! @belongsTo
  name: String!
  description: String
}

type User @model {
  id: ID!
  todos: Todo @hasOne
}

And the result when trying to create a Todo without a User: Pasted image 20221024133418 Observe that in the explorer the relationship is now mandatory: Pasted image 20221024133858

To accomplish the previous behavior with the @hasMany directive, the following model has to be used:

type Todo @model {
  id: ID!
  createdBy: User @belongsTo
  name: String!
  description: String
}

type User @model {
  id: ID!
  todos: [Todo]! @hasMany
}

Observe that the ! is placed in the Todo array ([Todo]!) Important note: It is not the same as [Todo!].

Looking at the results: Pasted image 20221024133948 And the explorer: Pasted image 20221024134035

Notice that the relationship is now required to create a Todo.

With that in mind, I found why the warnings are being printed and not letting the custom conflictHandler execute properly. It has to do with the use of the WeakSet class in the modelInstanceCreator function in datastore.ts:

function modelInstanceCreator<T extends PersistentModel>(
    modelConstructor: PersistentModelConstructor<T>,
    init: Partial<T>
): T {
    instancesMetadata.add(init);

    return new modelConstructor(<ModelInit<T, PersistentModelMetaData<T>>>init);
}

Look what happens when I create a WeakSet and try to add a null value in it:

image

It is the same warning you are getting! That means that something is being null when we call the modelInstanceCreator function, and that is error.data.

Take a look at the code that is being executed in mutation.ts in the datastore package:

if (error.errorType === 'ConflictUnhandled') {
      // TODO: add on ConflictConditionalCheck error query last from server
      attempt++;
      let retryWith: PersistentModel | typeof DISCARD;

      if (attempt > MAX_ATTEMPTS) {
          retryWith = DISCARD;
      } else {
          try {
              retryWith = await this.conflictHandler({
                  modelConstructor,
                  localModel: this.modelInstanceCreator(
                      modelConstructor,
                      variables.input
                  ),
                  remoteModel: this.modelInstanceCreator(
                      modelConstructor,
                      error.data // This is being null
                  ),
                  operation: opType,
                  attempts: attempt,
              });
          } catch (err) {
              logger.warn('conflict trycatch', err);
              continue;
          }
}

Observe that error.data is what is being null as shown in the request you showed:

{"data":{"updateTodo":null},"errors":[{"path":["updateTodo"],"data":null,"errorType":"ConflictUnhandled","errorInfo":null,"locations":[{"line":2,"column":3,"sourceName":null}],"message":"Conflict resolver rejects mutation."}]}

But why is that being null in the first place and not when you make the User optional in the schema?

Something else that I found was that the userTodosId is undefined when trying to upload to DataStore as shown in this image: Pasted image 20221021102119

The same happens even when the User is not required. My guess is that when you make the User not required, it doesn't check for the userTodosId when updating. I'll try to look deeper into your issue, but I wanted you to know what I found in the mean time.

ncarvajalc commented 2 years ago

Progress

Using the AppSync query console I used the query generated by Datastore to try to replicate the error.data being null: The results where the following:

Request query when the User is required and createdBy { id _deleted } is used :

mutation nullErrors {
  updateTodo(
    input: {
        description: "No",
        id: "cac76cab-a71c-48f1-ae23-bd9c529195ad",
        name: "F"
    }
  ) {
    id
    name
    description
    createdAt
    updatedAt
    _version
    _lastChangedAt
    _deleted
    createdBy { 
      id
      _deleted
    }
  }
}

Response

{
  "data": {
    "updateTodo": null
  },
  "errors": [
    {
      "path": [
        "updateTodo"
      ],
      "data": null,
      "errorType": "ConflictUnhandled",
      "errorInfo": null,
      "locations": [
        {
          "line": 27,
          "column": 3,
          "sourceName": null
        }
      ],
      "message": "Conflict resolver rejects mutation."
    }
  ]
}

In this case, errors.data is null.

There is a way for making the errors not null and it is removing the createdBy { id _deleted }.

Request query when the User is required without the createdBy { id _deleted }

mutation noNullErrors {
  updateTodo(
    input: {
        description: "No",
        id: "cac76cab-a71c-48f1-ae23-bd9c529195ad",
        name: "F"
    }
  ) {
    id
    name
    description
    createdAt
    updatedAt
    _version
    _lastChangedAt
    _deleted
  }
}

Response

{
  "data": {
    "updateTodo": null
  },
  "errors": [
    {
      "path": [
        "updateTodo"
      ],
      "data": {
        "id": "cac76cab-a71c-48f1-ae23-bd9c529195ad",
        "name": "TODO 2",
        "description": "My First TODO",
        "createdAt": "2022-10-24T19:33:10.203Z",
        "updatedAt": "2022-10-24T21:26:51.844Z",
        "_version": 9,
        "_lastChangedAt": 1666646811867,
        "_deleted": null
      },
      "errorType": "ConflictUnhandled",
      "errorInfo": null,
      "locations": [
        {
          "line": 2,
          "column": 3,
          "sourceName": null
        }
      ],
      "message": "Conflict resolver rejects mutation."
    }
  ]
}

So it seems it has to do with the presence of the @belongsTo model in the query.

Instead, the userTodosId can be used:

Request query with required User and userTodosId instead of createdBy { id _deleted }

mutation noNullErrors {
  updateTodo(
    input: {
        description: "No",
        id: "cac76cab-a71c-48f1-ae23-bd9c529195ad",
        name: "F"
    }
  ) {
    id
    name
    description
    createdAt
    updatedAt
    _version
    _lastChangedAt
    _deleted
    userTodosId  """This was added"""
  }
}

Response

{
  "data": {
    "updateTodo": null
  },
  "errors": [
    {
      "path": [
        "updateTodo"
      ],
      "data": {
        "id": "cac76cab-a71c-48f1-ae23-bd9c529195ad",
        "name": "TODO 2",
        "description": "My First TODO",
        "createdAt": "2022-10-24T19:33:10.203Z",
        "updatedAt": "2022-10-24T21:26:51.844Z",
        "_version": 9,
        "_lastChangedAt": 1666646811867,
        "_deleted": null,
        "userTodosId": "b3f5b495-5962-44cd-b08f-acbfff263133"
      },
      "errorType": "ConflictUnhandled",
      "errorInfo": null,
      "locations": [
        {
          "line": 2,
          "column": 3,
          "sourceName": null
        }
      ],
      "message": "Conflict resolver rejects mutation."
    }
  ]
}

What happens when the User is not required?

Request query sent when the User is required and createdBy { id _deleted } is used

mutation noNullErrors {
  updateTodo(input: {description: "No", id: "cac76cab-a71c-48f1-ae23-bd9c529195ad", name: "F"}) {
    id
    name
    description
    createdAt
    updatedAt
    _version
    _lastChangedAt
    _deleted
    createdBy {
      id
      _deleted
    }
  }
}

Response

{
  "data": {
    "updateTodo": null
  },
  "errors": [
    {
      "path": [
        "updateTodo"
      ],
      "data": {
        "id": "cac76cab-a71c-48f1-ae23-bd9c529195ad",
        "name": "TODO 2",
        "description": "My First TODO",
        "createdAt": "2022-10-24T19:33:10.203Z",
        "updatedAt": "2022-10-24T21:26:51.844Z",
        "_version": 9,
        "_lastChangedAt": 1666646811867,
        "_deleted": null,
        "createdBy": null
      },
      "errorType": "ConflictUnhandled",
      "errorInfo": null,
      "locations": [
        {
          "line": 25,
          "column": 3,
          "sourceName": null
        }
      ],
      "message": "Conflict resolver rejects mutation."
    }
  ]
}

For some reason when the User is not required the error.data is not null (I guess it has to do with error handling in AppSync). But notice that the createdBy field returns a null value, even though the Todo has a User associated (as seen when userTodosId is used). So the createdBy { id _deleted } can be safely replaced with the userTodosId to get that field (I am working in a PR to do that). Later, in your custom conflict handler, you can query the User by its id to see if there where any changes to the User if that is needed.

caridavidson commented 1 year ago

following. I was getting this, but switched to @hasOne to work around it for now.