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 - Backend subscriptions filtering error #13384

Open mhyassin opened 6 months ago

mhyassin commented 6 months ago

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Authentication, GraphQL API, DataStore, Storage

Amplify Version

v6

Amplify Categories

No response

Backend

None

Environment information

``` # Put output below this line System: OS: macOS 14.4.1 CPU: (10) arm64 Apple M1 Pro Memory: 88.72 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 10.7.0 - ~/.nvm/versions/node/v20.12.2/bin/npm Watchman: 2024.01.22.00 - /opt/homebrew/bin/watchman Browsers: Chrome: 124.0.6367.203 Safari: 17.4.1 npmPackages: @aws-amplify/react-native: 1.0.22 => 1.0.22 @aws-amplify/rtn-web-browser: 1.0.22 => 1.0.22 @azure/core-asynciterator-polyfill: 1.0.2 => 1.0.2 @babel/core: ^7.20.0 => 7.21.3 (7.23.2, 7.22.8, 7.18.13, 7.23.9) @babel/plugin-proposal-decorators: ^7.22.15 => 7.22.15 @babel/preset-env: ^7.20.0 => 7.20.2 (7.22.7) @babel/runtime: ^7.20.0 => 7.21.0 (7.19.0, 7.18.9) @commitlint/cli: ^17.0.3 => 17.0.3 @commitlint/config-conventional: ^17.0.3 => 17.0.3 @georstat/react-native-image-cache: 2.8.0 => 2.8.0 @graphql-codegen/cli: ^5.0.0 => 5.0.0 @graphql-codegen/client-preset: ^4.1.0 => 4.1.0 @nozbe/watermelondb: 0.27.1 => 0.27.1 @react-native-async-storage/async-storage: 1.21.0 => 1.21.0 @react-native-clipboard/clipboard: 1.13.2 => 1.13.2 @react-native-community/netinfo: 9.4.1 => 9.4.1 @react-native-firebase/app: 18.7.1 => 18.7.1 @react-native-firebase/messaging: 18.7.1 => 18.7.1 @react-native-masked-view/masked-view: 0.3.0 => 0.3.0 @react-native-picker/picker: 2.4.1 => 2.4.1 (1.16.8) @react-native/babel-preset: 0.73.21 => 0.73.21 @react-native/eslint-config: 0.73.2 => 0.73.2 @react-native/metro-config: 0.73.5 => 0.73.5 @react-native/typescript-config: 0.73.1 => 0.73.1 @react-navigation/bottom-tabs: 6.5.12 => 6.5.12 @react-navigation/elements: 1.3.22 => 1.3.22 @react-navigation/native: 6.1.10 => 6.1.10 @react-navigation/native-stack: 6.9.18 => 6.9.18 @react-navigation/stack: 6.3.21 => 6.3.21 @sentry/react-native: 5.19.3 => 5.19.3 @types/d3-scale: 4.0.3 => 4.0.3 @types/d3-shape: 3.1.6 => 3.1.6 @types/jest: ^29.5.12 => 29.5.12 @types/lodash: 4.14.185 => 4.14.185 @types/react: 18.2.6 => 18.2.6 (18.0.17) @types/react-native-vector-icons: 6.4.11 => 6.4.11 @types/react-native-version-check: 3.4.5 => 3.4.5 @types/react-test-renderer: 18.0.0 => 18.0.0 @typescript-eslint/eslint-plugin: ^5.61.0 => 5.61.0 (5.62.0) @typescript-eslint/parser: ^5.61.0 => 5.61.0 (5.62.0) @urql/exchange-auth: 2.1.6 => 2.1.6 HelloWorld: 0.0.1 aws-amplify: 6.0.21 => 6.0.21 aws-amplify/adapter-core: undefined () aws-amplify/analytics: undefined () aws-amplify/analytics/kinesis: undefined () aws-amplify/analytics/kinesis-firehose: undefined () aws-amplify/analytics/personalize: undefined () aws-amplify/analytics/pinpoint: undefined () aws-amplify/api: undefined () aws-amplify/api/server: undefined () aws-amplify/auth: undefined () aws-amplify/auth/cognito: undefined () aws-amplify/auth/cognito/server: undefined () aws-amplify/auth/enable-oauth-listener: undefined () aws-amplify/auth/server: undefined () aws-amplify/data: undefined () aws-amplify/data/server: undefined () aws-amplify/datastore: undefined () aws-amplify/in-app-messaging: undefined () aws-amplify/in-app-messaging/pinpoint: undefined () aws-amplify/push-notifications: undefined () aws-amplify/push-notifications/pinpoint: undefined () aws-amplify/storage: undefined () aws-amplify/storage/s3: undefined () aws-amplify/storage/s3/server: undefined () aws-amplify/storage/server: undefined () aws-amplify/utils: undefined () axios: 1.6.7 => 1.6.7 babel-jest: ^29.6.3 => 29.7.0 babel-plugin-module-resolver: 4.1.0 => 4.1.0 d3: 7.4.4 => 7.4.4 d3-array: 3.1.6 => 3.1.6 (3.2.0) d3-scale: 4.0.2 => 4.0.2 d3-shape: 3.1.0 => 3.1.0 date-fns: 2.28.0 => 2.28.0 emoji-regex: 10.3.0 => 10.3.0 (9.2.2, 8.0.0) eslint: ^8.21.0 => 8.22.0 eslint-config-prettier: 8.5.0 => 8.5.0 eslint-plugin-i18next: ^6.0.3 => 6.0.3 eslint-plugin-jest: ^26.8.2 => 26.8.7 fs-extra: ^10.1.0 => 10.1.0 (8.1.0, 11.1.1) graphql: 15.7.0 => 15.7.0 (15.8.0) husky: 8.0.1 => 8.0.1 i18n-unused: ^0.16.0 => 0.16.0 i18next: 21.8.10 => 21.8.10 javascript-time-ago: 2.5.9 => 2.5.9 javascript-time-ago/cache: undefined () javascript-time-ago/commonjs: undefined () javascript-time-ago/gradation: undefined () javascript-time-ago/load-all-locales: undefined () javascript-time-ago/locale/af: undefined () javascript-time-ago/locale/am: undefined () javascript-time-ago/locale/ar: undefined () javascript-time-ago/locale/ar-AE: undefined () javascript-time-ago/locale/as: undefined () javascript-time-ago/locale/ast: undefined () javascript-time-ago/locale/az: undefined () javascript-time-ago/locale/be: undefined () javascript-time-ago/locale/bg: undefined () javascript-time-ago/locale/bgc: undefined () javascript-time-ago/locale/bn: undefined () javascript-time-ago/locale/br: undefined () javascript-time-ago/locale/brx: undefined () javascript-time-ago/locale/bs: undefined () javascript-time-ago/locale/bs-Cyrl: undefined () javascript-time-ago/locale/ca: undefined () javascript-time-ago/locale/ccp: undefined () javascript-time-ago/locale/ce: undefined () javascript-time-ago/locale/ceb: undefined () javascript-time-ago/locale/chr: undefined () javascript-time-ago/locale/cs: undefined () javascript-time-ago/locale/cv: undefined () javascript-time-ago/locale/cy: undefined () javascript-time-ago/locale/da: undefined () javascript-time-ago/locale/de: undefined () javascript-time-ago/locale/dsb: undefined () javascript-time-ago/locale/dz: undefined () javascript-time-ago/locale/ee: undefined () javascript-time-ago/locale/el: undefined () javascript-time-ago/locale/en: undefined () javascript-time-ago/locale/en-001: undefined () javascript-time-ago/locale/en-150: undefined () javascript-time-ago/locale/en-AG: undefined () javascript-time-ago/locale/en-AI: undefined () javascript-time-ago/locale/en-AT: undefined () javascript-time-ago/locale/en-AU: undefined () javascript-time-ago/locale/en-BB: undefined () javascript-time-ago/locale/en-BE: undefined () javascript-time-ago/locale/en-BM: undefined () javascript-time-ago/locale/en-BS: undefined () javascript-time-ago/locale/en-BW: undefined () javascript-time-ago/locale/en-BZ: undefined () javascript-time-ago/locale/en-CA: undefined () javascript-time-ago/locale/en-CC: undefined () javascript-time-ago/locale/en-CH: undefined () javascript-time-ago/locale/en-CK: undefined () javascript-time-ago/locale/en-CM: undefined () javascript-time-ago/locale/en-CX: undefined () javascript-time-ago/locale/en-CY: undefined () javascript-time-ago/locale/en-DE: undefined () javascript-time-ago/locale/en-DG: undefined () javascript-time-ago/locale/en-DK: undefined () javascript-time-ago/locale/en-DM: undefined () javascript-time-ago/locale/en-ER: undefined () javascript-time-ago/locale/en-FI: undefined () javascript-time-ago/locale/en-FJ: undefined () javascript-time-ago/locale/en-FK: undefined () javascript-time-ago/locale/en-FM: undefined () javascript-time-ago/locale/en-GB: undefined () javascript-time-ago/locale/en-GD: undefined () javascript-time-ago/locale/en-GG: undefined () javascript-time-ago/locale/en-GH: undefined () javascript-time-ago/locale/en-GI: undefined () javascript-time-ago/locale/en-GM: undefined () javascript-time-ago/locale/en-GY: undefined () javascript-time-ago/locale/en-HK: undefined () javascript-time-ago/locale/en-IE: undefined () javascript-time-ago/locale/en-IL: undefined () javascript-time-ago/locale/en-IM: undefined () javascript-time-ago/locale/en-IN: undefined () javascript-time-ago/locale/en-IO: undefined () javascript-time-ago/locale/en-JE: undefined () javascript-time-ago/locale/en-JM: undefined () javascript-time-ago/locale/en-KE: undefined () javascript-time-ago/locale/en-KI: undefined () javascript-time-ago/locale/en-KN: undefined () javascript-time-ago/locale/en-KY: undefined () javascript-time-ago/locale/en-LC: undefined () javascript-time-ago/locale/en-LR: undefined () javascript-time-ago/locale/en-LS: undefined () javascript-time-ago/locale/en-MG: undefined () javascript-time-ago/locale/en-MO: undefined () javascript-time-ago/locale/en-MS: undefined () javascript-time-ago/locale/en-MT: undefined () javascript-time-ago/locale/en-MU: undefined () javascript-time-ago/locale/en-MV: undefined () javascript-time-ago/locale/en-MW: undefined () javascript-time-ago/locale/en-MY: undefined () javascript-time-ago/locale/en-NA: undefined () javascript-time-ago/locale/en-NF: undefined () javascript-time-ago/locale/en-NG: undefined () javascript-time-ago/locale/en-NL: undefined () javascript-time-ago/locale/en-NR: undefined () javascript-time-ago/locale/en-NU: undefined () javascript-time-ago/locale/en-NZ: undefined () javascript-time-ago/locale/en-PG: undefined () javascript-time-ago/locale/en-PK: undefined () javascript-time-ago/locale/en-PN: undefined () javascript-time-ago/locale/en-PW: undefined () javascript-time-ago/locale/en-RW: undefined () javascript-time-ago/locale/en-SB: undefined () javascript-time-ago/locale/en-SC: undefined () javascript-time-ago/locale/en-SD: undefined () javascript-time-ago/locale/en-SE: undefined () javascript-time-ago/locale/en-SG: undefined () javascript-time-ago/locale/en-SH: undefined () javascript-time-ago/locale/en-SI: undefined () javascript-time-ago/locale/en-SL: undefined () javascript-time-ago/locale/en-SS: undefined () javascript-time-ago/locale/en-SX: undefined () javascript-time-ago/locale/en-SZ: undefined () javascript-time-ago/locale/en-TC: undefined () javascript-time-ago/locale/en-TK: undefined () javascript-time-ago/locale/en-TO: undefined () javascript-time-ago/locale/en-TT: undefined () javascript-time-ago/locale/en-TV: undefined () javascript-time-ago/locale/en-TZ: undefined () javascript-time-ago/locale/en-UG: undefined () javascript-time-ago/locale/en-VC: undefined () javascript-time-ago/locale/en-VG: undefined () javascript-time-ago/locale/en-VU: undefined () javascript-time-ago/locale/en-WS: undefined () javascript-time-ago/locale/en-ZA: undefined () javascript-time-ago/locale/en-ZM: undefined () javascript-time-ago/locale/en-ZW: undefined () javascript-time-ago/locale/eo: undefined () javascript-time-ago/locale/es: undefined () javascript-time-ago/locale/es-419: undefined () javascript-time-ago/locale/es-AR: undefined () javascript-time-ago/locale/es-BO: undefined () javascript-time-ago/locale/es-BR: undefined () javascript-time-ago/locale/es-BZ: undefined () javascript-time-ago/locale/es-CL: undefined () javascript-time-ago/locale/es-CO: undefined () javascript-time-ago/locale/es-CR: undefined () javascript-time-ago/locale/es-CU: undefined () javascript-time-ago/locale/es-DO: undefined () javascript-time-ago/locale/es-EC: undefined () javascript-time-ago/locale/es-GT: undefined () javascript-time-ago/locale/es-HN: undefined () javascript-time-ago/locale/es-MX: undefined () javascript-time-ago/locale/es-NI: undefined () javascript-time-ago/locale/es-PA: undefined () javascript-time-ago/locale/es-PE: undefined () javascript-time-ago/locale/es-PR: undefined () javascript-time-ago/locale/es-PY: undefined () javascript-time-ago/locale/es-SV: undefined () javascript-time-ago/locale/es-US: undefined () javascript-time-ago/locale/es-UY: undefined () javascript-time-ago/locale/es-VE: undefined () javascript-time-ago/locale/et: undefined () javascript-time-ago/locale/eu: undefined () javascript-time-ago/locale/fa: undefined () javascript-time-ago/locale/ff-Adlm: undefined () javascript-time-ago/locale/fi: undefined () javascript-time-ago/locale/fil: undefined () javascript-time-ago/locale/fo: undefined () javascript-time-ago/locale/fr: undefined () javascript-time-ago/locale/fr-CA: undefined () javascript-time-ago/locale/fur: undefined () javascript-time-ago/locale/fy: undefined () javascript-time-ago/locale/ga: undefined () javascript-time-ago/locale/gd: undefined () javascript-time-ago/locale/gl: undefined () javascript-time-ago/locale/gu: undefined () javascript-time-ago/locale/ha: undefined () javascript-time-ago/locale/he: undefined () javascript-time-ago/locale/hi: undefined () javascript-time-ago/locale/hi-Latn: undefined () javascript-time-ago/locale/hr: undefined () javascript-time-ago/locale/hsb: undefined () javascript-time-ago/locale/hu: undefined () javascript-time-ago/locale/hy: undefined () javascript-time-ago/locale/ia: undefined () javascript-time-ago/locale/id: undefined () javascript-time-ago/locale/ig: undefined () javascript-time-ago/locale/is: undefined () javascript-time-ago/locale/it: undefined () javascript-time-ago/locale/ja: undefined () javascript-time-ago/locale/jgo: undefined () javascript-time-ago/locale/jv: undefined () javascript-time-ago/locale/ka: undefined () javascript-time-ago/locale/kea: undefined () javascript-time-ago/locale/kgp: undefined () javascript-time-ago/locale/kk: undefined () javascript-time-ago/locale/kl: undefined () javascript-time-ago/locale/km: undefined () javascript-time-ago/locale/kn: undefined () javascript-time-ago/locale/ko: undefined () javascript-time-ago/locale/kok: undefined () javascript-time-ago/locale/ks: undefined () javascript-time-ago/locale/ksh: undefined () javascript-time-ago/locale/ku: undefined () javascript-time-ago/locale/ky: undefined () javascript-time-ago/locale/lb: undefined () javascript-time-ago/locale/lkt: undefined () javascript-time-ago/locale/lo: undefined () javascript-time-ago/locale/lt: undefined () javascript-time-ago/locale/lv: undefined () javascript-time-ago/locale/mai: undefined () javascript-time-ago/locale/mi: undefined () javascript-time-ago/locale/mk: undefined () javascript-time-ago/locale/ml: undefined () javascript-time-ago/locale/mn: undefined () javascript-time-ago/locale/mni: undefined () javascript-time-ago/locale/mr: undefined () javascript-time-ago/locale/ms: undefined () javascript-time-ago/locale/mt: undefined () javascript-time-ago/locale/my: undefined () javascript-time-ago/locale/mzn: undefined () javascript-time-ago/locale/nb: undefined () javascript-time-ago/locale/ne: undefined () javascript-time-ago/locale/nl: undefined () javascript-time-ago/locale/nn: undefined () javascript-time-ago/locale/no: undefined () javascript-time-ago/locale/or: undefined () javascript-time-ago/locale/pa: undefined () javascript-time-ago/locale/pcm: undefined () javascript-time-ago/locale/pl: undefined () javascript-time-ago/locale/ps: undefined () javascript-time-ago/locale/ps-PK: undefined () javascript-time-ago/locale/pt: undefined () javascript-time-ago/locale/pt-AO: undefined () javascript-time-ago/locale/pt-CH: undefined () javascript-time-ago/locale/pt-CV: undefined () javascript-time-ago/locale/pt-GQ: undefined () javascript-time-ago/locale/pt-GW: undefined () javascript-time-ago/locale/pt-LU: undefined () javascript-time-ago/locale/pt-MO: undefined () javascript-time-ago/locale/pt-MZ: undefined () javascript-time-ago/locale/pt-PT: undefined () javascript-time-ago/locale/pt-ST: undefined () javascript-time-ago/locale/pt-TL: undefined () javascript-time-ago/locale/qu: undefined () javascript-time-ago/locale/raj: undefined () javascript-time-ago/locale/rm: undefined () javascript-time-ago/locale/ro: undefined () javascript-time-ago/locale/ru: undefined () javascript-time-ago/locale/sah: undefined () javascript-time-ago/locale/sc: undefined () javascript-time-ago/locale/sd: undefined () javascript-time-ago/locale/se: undefined () javascript-time-ago/locale/se-FI: undefined () javascript-time-ago/locale/si: undefined () javascript-time-ago/locale/sk: undefined () javascript-time-ago/locale/sl: undefined () javascript-time-ago/locale/so: undefined () javascript-time-ago/locale/sq: undefined () javascript-time-ago/locale/sr: undefined () javascript-time-ago/locale/sr-Cyrl-BA: undefined () javascript-time-ago/locale/sr-Latn: undefined () javascript-time-ago/locale/sr-Latn-BA: undefined () javascript-time-ago/locale/su: undefined () javascript-time-ago/locale/sv: undefined () javascript-time-ago/locale/sw: undefined () javascript-time-ago/locale/ta: undefined () javascript-time-ago/locale/te: undefined () javascript-time-ago/locale/tg: undefined () javascript-time-ago/locale/th: undefined () javascript-time-ago/locale/ti: undefined () javascript-time-ago/locale/tk: undefined () javascript-time-ago/locale/to: undefined () javascript-time-ago/locale/tr: undefined () javascript-time-ago/locale/tt: undefined () javascript-time-ago/locale/ug: undefined () javascript-time-ago/locale/uk: undefined () javascript-time-ago/locale/ur: undefined () javascript-time-ago/locale/ur-IN: undefined () javascript-time-ago/locale/uz: undefined () javascript-time-ago/locale/uz-Cyrl: undefined () javascript-time-ago/locale/vi: undefined () javascript-time-ago/locale/wae: undefined () javascript-time-ago/locale/wo: undefined () javascript-time-ago/locale/xh: undefined () javascript-time-ago/locale/yi: undefined () javascript-time-ago/locale/yo: undefined () javascript-time-ago/locale/yo-BJ: undefined () javascript-time-ago/locale/yrl: undefined () javascript-time-ago/locale/yue: undefined () javascript-time-ago/locale/yue-Hans: undefined () javascript-time-ago/locale/zh: undefined () javascript-time-ago/locale/zh-Hans-HK: undefined () javascript-time-ago/locale/zh-Hans-MO: undefined () javascript-time-ago/locale/zh-Hans-SG: undefined () javascript-time-ago/locale/zh-Hant: undefined () javascript-time-ago/locale/zh-Hant-HK: undefined () javascript-time-ago/locale/zh-Hant-MO: undefined () javascript-time-ago/locale/zu: undefined () javascript-time-ago/prop-types: undefined () javascript-time-ago/steps: undefined () jest: ^29.6.3 => 29.7.0 jest-environment-jsdom: ^29.5.0 => 29.5.0 jest-transform-stub: 2.0.0 => 2.0.0 jotai: 2.7.0 => 2.7.0 lint-staged: ^13.2.3 => 13.2.3 lodash: 4.17.21 => 4.17.21 lottie-react-native: 6.4.1 => 6.4.1 moment: 2.29.4 => 2.29.4 observable-hooks: 4.2.3 => 4.2.3 polished: 4.2.2 => 4.2.2 posthog-react-native: 3.1.1 => 3.1.1 postinstall-postinstall: 2.1.0 => 2.1.0 prettier: 2.8.8 => 2.8.8 (3.1.0) react: 18.2.0 => 18.2.0 react-i18next: 11.18.3 => 11.18.3 react-native: 0.73.6 => 0.73.6 react-native-appsflyer: 6.12.2 => 6.12.2 react-native-autocomplete-input: 5.4.0 => 5.4.0 react-native-bootsplash: 5.1.3 => 5.1.3 react-native-config: 1.4.6 => 1.4.6 react-native-context-menu-view: 1.15.0 => 1.15.0 react-native-date-picker: 4.3.3 => 4.3.3 react-native-device-info: 10.12.0 => 10.12.0 react-native-email-link: 1.14.1 => 1.14.1 react-native-file-access: 3.0.7 => 3.0.7 react-native-gesture-handler: 2.15.0 => 2.15.0 react-native-get-random-values: 1.11.0 => 1.11.0 react-native-image-crop-picker: 0.39.0 => 0.39.0 react-native-in-app-review: 4.3.3 => 4.3.3 react-native-inappbrowser-reborn: 3.7.0 => 3.7.0 react-native-keyboard-aware-scroll-view: 0.9.5 => 0.9.5 react-native-keyboard-controller: 1.10.0 => 1.10.0 react-native-linear-gradient: 2.8.3 => 2.8.3 react-native-localize: 2.2.4 => 2.2.4 react-native-marked: 6.0.4 => 6.0.4 react-native-picker-select: 8.0.4 => 8.0.4 react-native-purchases: 7.5.0 => 7.5.0 react-native-reanimated: 3.6.1 => 3.6.1 react-native-reanimated-carousel: 3.3.2 => 3.3.2 react-native-safe-area-context: 4.9.0 => 4.9.0 react-native-screens: 3.29.0 => 3.29.0 react-native-share: 10.0.2 => 10.0.2 react-native-shared-element: 0.8.4 => 0.8.4 react-native-snackbar: 2.4.0 => 2.4.0 react-native-svg: 12.4.4 => 12.4.4 (13.14.0) react-native-svg-transformer: 1.3.0 => 1.3.0 react-native-toast-message: 2.1.5 => 2.1.5 react-native-track-player: 4.1.1 => 4.1.1 react-native-vector-icons: 10.0.2 => 10.0.2 react-native-version-check: 3.4.7 => 3.4.7 react-native-webview: 13.6.3 => 13.6.3 react-navigation-shared-element: 3.1.3 => 3.1.3 react-test-renderer: 18.2.0 => 18.2.0 react-time-ago: 7.2.1 => 7.2.1 react-time-ago/commonjs: undefined () reselect: 5.1.0 => 5.1.0 (4.1.6) styled-components: 6.0.4 => 6.0.4 styled-components/macro: undefined () styled-components/native: undefined () terra-react: 1.6.5 => 1.6.10 tiny-timer: 1.6.0 => 1.6.0 ts-jest: ^29.1.1 => 29.1.1 ts-node: ^10.9.1 => 10.9.1 typescript: 5.0.4 => 5.0.4 (4.7.4) urql: 4.0.5 => 4.0.5 urql-core: undefined () zustand: 4.3.6 => 4.3.6 npmGlobalPackages: corepack: 0.25.2 npm: 10.7.0 ```

Describe the bug

I'm getting this issue when adding syncExpressions to the Datastore configuration For more context see https://github.com/aws-amplify/amplify-category-api/issues/1796

[WARN] 48:37.685 DataStore - Backend subscriptions filtering error.
Subscriptions filtering will be applied clientside.

Connection failed: {"errors":[{"message":"subscription filter uses same fieldName multiple time in single filter object.","errorCode":400}]}
Your selective sync expression for User contains multiple entries for null in the same AND group.

Expected behavior

The syncExpressions should run without any filtering errors

Reproduction steps

  1. create a model with a custom primary key
  2. use this primary key in the model's syncExpression

Code Snippet

// Put your code below this line.
DataStore.configure({
  syncExpressions: [
    syncExpression(Model, (m) =>
      m.user_name.eq('XXX')
    ),
  ],
});

Log output

``` // Put your logs below this line LOG [DEBUG] 48:37.677 AWSAppSyncRealTimeProvider - Connection failed: {"errors":[{"message":"subscription filter uses same fieldName multiple time in single filter object.","errorCode":400}]} WARN [WARN] 48:37.685 DataStore - Backend subscriptions filtering error. Subscriptions filtering will be applied clientside. Connection failed: {"errors":[{"message":"subscription filter uses same fieldName multiple time in single filter object.","errorCode":400}]} Your selective sync expression for User contains multiple entries for null in the same AND group. LOG [DEBUG] 48:37.690 AWSAppSyncRealTimeProvider - Error while unsubscribing Error: Subscription never connected LOG [DEBUG] 48:37.690 DataStore - Attempting Update subscription with authMode: userPool LOG [DEBUG] 48:37.693 AWSAppSyncRealTimeProvider - Authenticating with "userPool" LOG [DEBUG] 48:37.712 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"id":"XXX","type":"error","payload":{"errors":[{"message":"subscription filter uses same fieldName multiple time in single filter object.","errorCode":400}]}} ```

aws-exports.js

No response

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 6 months ago

Hi @mhyassin, thanks for raising this issue and providing reproduction steps.

Can you confirm what version of the Amplify CLI you're using?

amplify --version

Also, if you can, please share you schema. Using a custom primary key might be enough to reproduce the issue but it might be helpful just in case there's something else we might be missing in our reproduction efforts.

mhyassin commented 6 months ago

Hi @chrisbonifacio, I'm using amplify v12.12.0 and this is how the model looks like in the schema:

type User
  @model
  @auth(
    rules: [
      {
        allow: owner
        operations: [read, update, create, delete]
        identityClaim: "username" # explicit use of username
        ownerField: "user_name"
      }
    ]
  ) {
  user_name: String! @primaryKey
  email: String!

  firstname: String
  lastname: String
  # and other optional attrs
}
ajkpersonal commented 5 months ago

I get the same error with the following schema:

type UserObject @model @auth(rules: [{ allow: owner, ownerField: "id" }]) {
    id: ID!
    other: String
}

Seems to be an issue with the ownerfield being set to the primary key field.

jon144 commented 2 months ago

Falling back to client-side filtering is really bad for our app. Is there estimated fix date for this error?

jon144 commented 1 month ago

Is there any updated on when this might get fixed. Our schema relies on this working.