Closed laclance closed 1 year ago
maybe related https://github.com/aws-amplify/amplify-js/issues/6488
Hey @laclance 👋 thanks for raising this issue. Could you please share your schema so that we can more closely reproduce this issue?
I noticed you're on the latest version of aws-amplify
. The same day you posted this issue, another was opened regarding IndexedDB throwing the same AbortError
on Safari. Please try downgrading to aws-amplify@4.3.37
or lower and let me know if the issue persists.
Thank you!
export const schema = {
"models": {
"TallorderPos": {
"name": "TallorderPos",
"fields": {
"id": {
"name": "id",
"isArray": false,
"type": "ID",
"isRequired": true,
"attributes": []
},
"pk": {
"name": "pk",
"isArray": false,
"type": "String",
"isRequired": true,
"attributes": []
},
"sk": {
"name": "sk",
"isArray": false,
"type": "String",
"isRequired": true,
"attributes": []
},
"entityType": {
"name": "entityType",
"isArray": false,
"type": {
"enum": "EntityType"
},
"isRequired": true,
"attributes": []
},
"entityTag": {
"name": "entityTag",
"isArray": false,
"type": "String",
"isRequired": false,
"attributes": []
},
"currentState": {
"name": "currentState",
"isArray": false,
"type": {
"enum": "CurrentState"
},
"isRequired": true,
"attributes": []
},
"data": {
"name": "data",
"isArray": false,
"type": "AWSJSON",
"isRequired": false,
"attributes": []
},
"gsi1Pk": {
"name": "gsi1Pk",
"isArray": false,
"type": "String",
"isRequired": false,
"attributes": []
},
"gsi1Sk": {
"name": "gsi1Sk",
"isArray": false,
"type": "String",
"isRequired": false,
"attributes": []
},
"createdAt": {
"name": "createdAt",
"isArray": false,
"type": "AWSDateTime",
"isRequired": false,
"attributes": [],
"isReadOnly": true
},
"updatedAt": {
"name": "updatedAt",
"isArray": false,
"type": "AWSDateTime",
"isRequired": false,
"attributes": [],
"isReadOnly": true
}
},
"syncable": true,
"pluralName": "TallorderPos",
"attributes": [
{
"type": "model",
"properties": {}
},
{
"type": "key",
"properties": {
"name": "gsiPk-index",
"queryField": "GetTallorderPosByPk",
"fields": [
"pk",
"sk"
]
}
},
{
"type": "key",
"properties": {
"name": "gsiEntity-index",
"queryField": "GetTallorderPosByEntityType",
"fields": [
"entityType",
"entityTag"
]
}
},
{
"type": "key",
"properties": {
"name": "gsi1-index",
"queryField": "GetTallorderPosByGSI1",
"fields": [
"gsi1Pk",
"gsi1Sk"
]
}
},
{
"type": "auth",
"properties": {
"rules": [
{
"allow": "public",
"operations": [
"create",
"update",
"delete",
"read"
]
}
]
}
}
]
},
"TallorderSettings": {
"name": "TallorderSettings",
"fields": {
"id": {
"name": "id",
"isArray": false,
"type": "ID",
"isRequired": true,
"attributes": []
},
"pk": {
"name": "pk",
"isArray": false,
"type": "String",
"isRequired": true,
"attributes": []
},
"sk": {
"name": "sk",
"isArray": false,
"type": "String",
"isRequired": true,
"attributes": []
},
"entityType": {
"name": "entityType",
"isArray": false,
"type": {
"enum": "EntityType"
},
"isRequired": true,
"attributes": []
},
"entityTag": {
"name": "entityTag",
"isArray": false,
"type": "String",
"isRequired": false,
"attributes": []
},
"currentState": {
"name": "currentState",
"isArray": false,
"type": {
"enum": "CurrentState"
},
"isRequired": true,
"attributes": []
},
"data": {
"name": "data",
"isArray": false,
"type": "AWSJSON",
"isRequired": false,
"attributes": []
},
"gsi1Pk": {
"name": "gsi1Pk",
"isArray": false,
"type": "String",
"isRequired": false,
"attributes": []
},
"gsi1Sk": {
"name": "gsi1Sk",
"isArray": false,
"type": "String",
"isRequired": false,
"attributes": []
},
"createdAt": {
"name": "createdAt",
"isArray": false,
"type": "AWSDateTime",
"isRequired": false,
"attributes": [],
"isReadOnly": true
},
"updatedAt": {
"name": "updatedAt",
"isArray": false,
"type": "AWSDateTime",
"isRequired": false,
"attributes": [],
"isReadOnly": true
}
},
"syncable": true,
"pluralName": "TallorderSettings",
"attributes": [
{
"type": "model",
"properties": {}
},
{
"type": "key",
"properties": {
"name": "gsiPk-index",
"queryField": "GetTallorderSettingsByPk",
"fields": [
"pk",
"sk"
]
}
},
{
"type": "key",
"properties": {
"name": "gsiEntity-index",
"queryField": "GetTallorderSettingsByEntityType",
"fields": [
"entityType",
"entityTag"
]
}
},
{
"type": "key",
"properties": {
"name": "gsi1-index",
"queryField": "GetTallorderSettingsByGSI1",
"fields": [
"gsi1Pk",
"gsi1Sk"
]
}
},
{
"type": "auth",
"properties": {
"rules": [
{
"allow": "public",
"operations": [
"create",
"update",
"delete",
"read"
]
}
]
}
}
]
}
},
"enums": {
"EntityType": {
"name": "EntityType",
"values": [
"CreditNote",
"CreditNoteItem",
"Customer",
"CustomerAccount",
"GlobalAppEnum",
"GlobalSetting",
"GlobalAccountSystem",
"GlobalCountry",
"GlobalCurrency",
"GlobalLanguage",
"GlobalPaymentType",
"GlobalStockUnit",
"GlobalTaxRegime",
"AccountPayment",
"LocationDepartment",
"LocationDevice",
"LocationItem",
"LocationHeading",
"LocationProduct",
"LocationProductMedia",
"LocationMedia",
"LocationMenu",
"LocationMenuHeading",
"LocationMenuItem",
"LocationMenuProduct",
"LocationMenuTree",
"LocationPaymentType",
"LocationAddOn",
"LocationAddOnGroup",
"LocationProductAddOn",
"LocationProductAddOnGroup",
"LocationProductModifier",
"LocationOption",
"LocationOptionGroup",
"LocationProductOption",
"LocationProductOptionGroup",
"LocationPortion",
"LocationPortionGroup",
"LocationProductPortion",
"LocationProductPortionGroup",
"LocationSetting",
"LocationStaff",
"LocationStockItem",
"LocationStockAdjustment",
"LocationStockUnit",
"LocationStore",
"LocationStoreApproval",
"LocationStoreStockTake",
"LocationStoreStockTakeItem",
"LocationSupplier",
"LocationStockTakeType",
"LocationPayment",
"LocationTaxGroup",
"LocationTaxType",
"LocationTag",
"Merchant",
"MerchantAudit",
"MerchantDepartment",
"MerchantDevice",
"MerchantFolder",
"MerchantGalleryState",
"MerchantHeading",
"MerchantProduct",
"MerchantProductMedia",
"MerchantMedia",
"MerchantMenu",
"MerchantMenuHeading",
"MerchantMenuItem",
"MerchantMenuProduct",
"MerchantPaymentType",
"MerchantAddOn",
"MerchantAddOnGroup",
"MerchantProductAddOn",
"MerchantProductAddOnGroup",
"MerchantProductModifier",
"MerchantOption",
"MerchantOptionGroup",
"MerchantOrderApproval",
"MerchantProductOption",
"MerchantProductOptionGroup",
"MerchantPortion",
"MerchantPortionGroup",
"MerchantProductPortion",
"MerchantProductPortionGroup",
"MerchantProductRecipe",
"MerchantProductRecipeItem",
"MerchantReport",
"MerchantLocationReport",
"MerchantStoreReport",
"MerchantSellingLocation",
"MerchantSetting",
"MerchantStaff",
"MerchantStaffAccess",
"MerchantStaffApproval",
"MerchantStockUnit",
"MerchantStore",
"MerchantSupplier",
"MerchantStockTakeType",
"MerchantTaxType",
"MerchantTag",
"MerchantUser",
"Note",
"POSPettyCash",
"POSShift",
"POSTab",
"POSTabOrderLine",
"POSTabPayment",
"PurchaseOrder",
"PurchaseOrderItem",
"PurchaseOrderTemplate",
"PurchaseOrderItemTemplate",
"PendingPurchaseOrder",
"PendingPurchaseOrderItem",
"Refund",
"StockAdjustment",
"StockIssue",
"StockIssueItem",
"StockTake",
"StockTakeItem",
"StockRequisition",
"StockRequisitionItem",
"StockRequisitionTemplate",
"StockRequisitionItemTemplate",
"StockTransfer",
"StockTransferItem",
"StockTransferTemplate",
"StockTransferItemTemplate",
"SupplierReturn",
"SupplierReturnItem"
]
},
"CurrentState": {
"name": "CurrentState",
"values": [
"ACTIVE",
"ADJUST",
"ARCHIVED",
"CLOSED",
"COMPLETE",
"DRAFT",
"DRAFT_APPROVAL",
"INACTIVE",
"PLACED",
"PLACED_APPROVAL",
"PENDING",
"OPEN",
"RECEIVED",
"REJECTED",
"TEMPLATE"
]
}
},
"nonModels": {},
"version": "4767ca03090c2ef28d4487fb4cffd86c"
};
@chrisbonifacio thanks downgraded to aws-amplify@4.3.37 and it's working on safari.
on my android, which is much slower than my iphone i still get Uncaught (in promise): DOMException: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing
but then after that datastore still syncs fine. Maybe also related to https://github.com/aws-amplify/amplify-js/issues/9282
Eventually to run into errors on safari:
Uncaught (in promise): TypeError: undefined is not an object (evaluating 'head.operation')
[WARN] 23:29.174 DataStore - subscriptionErrorConnection closed
Amplify errorObject {error: Object}
Amplify error
error: Object {recoverySuggestion: "Ensure app code is up to date, auth directives exist and are correct on each model, and that server-side data has not been invalidated by a schema change. If the problem persists, search for or create an issue: https://github.com/aws-amplify/amplify-js/issues", localModel: null, message: "Connection closed", model: "TallorderSettings", operation: "Delete", errorType: "Unknown", process: "subscribe", remoteModel: null, cause: Object}
We just released a fix for DataStore in Safari browsers in aws-amplify@4.3.40
. Please let us know if this resolves this issue as well.
Cannot find module '@aws-sdk/util-credentials'
@aws-sdk/util-credentials
is not a dependency of Amplify and is not called from the library.
Which platform are you experiencing this on? Can you share the stack trace for this error? What happens if you manually install this dependency into your application?
All platforms, as soon as I upgrade to 4.3.4*
Uncaught Error: Cannot find module '@aws-sdk/util-credentials'
Require stack:
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveSsoCredentials.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/resolveProfileData.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/fromIni.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/credential-provider-node/dist-cjs/defaultProvider.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/client-sts/dist-cjs/STS.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/client-sts/dist-cjs/index.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/dist-cjs/runtimeConfig.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/dist-cjs/LocationClient.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/dist-cjs/Location.js
- /home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/dist-cjs/index.js
- /home/lance/to-pos-nextjs/node_modules/@aws-amplify/geo/lib/Providers/AmazonLocationServiceProvider.js
- /home/lance/to-pos-nextjs/node_modules/@aws-amplify/geo/lib/Geo.js
- /home/lance/to-pos-nextjs/node_modules/@aws-amplify/geo/lib/index.js
- /home/lance/to-pos-nextjs/node_modules/aws-amplify/lib/index.js
- /home/lance/to-pos-nextjs/.next/server/pages/_app.js
- /home/lance/to-pos-nextjs/node_modules/next/dist/server/require.js
- /home/lance/to-pos-nextjs/node_modules/next/dist/server/next-server.js
- /home/lance/to-pos-nextjs/node_modules/next/dist/server/dev/next-dev-server.js
- /home/lance/to-pos-nextjs/node_modules/next/dist/server/next.js
- /home/lance/to-pos-nextjs/node_modules/next/dist/server/lib/start-server.js
- /home/lance/to-pos-nextjs/node_modules/next/dist/cli/next-dev.js
- /home/lance/to-pos-nextjs/node_modules/next/dist/lib/commands.js
- /home/lance/to-pos-nextjs/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (:3000/internal/modules/cjs/loader.js:902:15)
at Function.mod._resolveFilename (/home/lance/to-pos-nextjs/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at Function.Module._load (:3000/internal/modules/cjs/loader.js:746:27)
at Module.require (:3000/internal/modules/cjs/loader.js:974:19)
at require (:3000/internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (/home/lance/to-pos-nextjs/node_modules/@aws-sdk/client-location/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js:7:28)
at Module._compile (:3000/internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (:3000/internal/modules/cjs/loader.js:1114:10)
at Module.load (:3000/internal/modules/cjs/loader.js:950:32)
at Function.Module._load (:3000/internal/modules/cjs/loader.js:790:12)
installing @aws-sdk/util-credentials removes the error and I am not getting any safari issues anymore.
Before opening, please confirm:
JavaScript Framework
React, Next.js
Amplify APIs
DataStore
Amplify Categories
No response
Environment information
Describe the bug
Been running datastore fine on desktop for about 2 years now but when calling DataStore.start() on a mobile device I get 2 errors.
Sometimes everything works fine and also sometimes I get no error but after syncQueriesStarted event gets fired nothing happens afterwards, modelSynced event does not fire.
Expected behavior
Should run the same as on a desktop.
Reproduction steps
run DataStore.start()
Code Snippet
Log output
aws-exports.js
Manual configuration
No response
Additional configuration
No response
Mobile Device
2 iPhones and 2 Androids
Mobile Operating System
Old and new
Mobile Browser
brave, chrome and safari
Mobile Browser Version
No response
Additional information and screenshots
No response