Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard setFilter - JSON.stringify - cyclical structure error #1340

Closed
1t5j0y opened this issue Mar 8, 2024 · 2 comments
Closed

Dashboard setFilter - JSON.stringify - cyclical structure error #1340

1t5j0y opened this issue Mar 8, 2024 · 2 comments
Assignees

Comments

@1t5j0y
Copy link
Contributor

1t5j0y commented Mar 8, 2024

https://app.bugsnag.com/samanvay-research-and-development-foundation/avni-client/errors/65ea8f3c4880080008b8db4c
Stacktrace:

TypeError Fatal error: cyclical structure in JSON object 
    native stringify
    /home/circleci/avni-client/packages/openchs-android/node_modules/openchs-models/dist/DashboardCache.js:62:36 setFilter
    /home/circleci/avni-client/packages/openchs-android/src/service/DashboardCacheService.js:55:36 anonymous
    native write
    /home/circleci/avni-client/packages/openchs-android/node_modules/openchs-models/dist/framework/RealmProxy.js:113:29 write
    /home/circleci/avni-client/packages/openchs-android/src/service/DashboardCacheService.js:53:21 updateFilter
    /home/circleci/avni-client/packages/openchs-android/src/action/mydashboard/MyDashboardActions.js:57:38 updateCachedFilter
    /home/circleci/avni-client/packages/openchs-android/src/action/mydashboard/MyDashboardActions.js:389:26 assignFilters
    /home/circleci/avni-client/packages/openchs-android/src/reducer/Reducer.js:22:43 anonymous
    /home/circleci/avni-client/packages/openchs-android/node_modules/redux/lib/redux.js:568:35 combination
    /home/circleci/avni-client/packages/openchs-android/node_modules/redux/lib/redux.js:296:35 dispatch
    /home/circleci/avni-client/packages/openchs-android/src/framework/view/AbstractComponent.js:56:63 dispatchAction
    /home/circleci/avni-client/packages/openchs-android/src/views/filter/FiltersView.js:116:34 applyFilters
    /home/circleci/avni-client/packages/openchs-android/src/views/filter/FiltersView.js:110:46 anonymous
    native apply
    /home/circleci/avni-client/packages/openchs-android/node_modules/react-native/Libraries/Core/Timers/JSTimers.js:213:22 anonymous
    /home/circleci/avni-client/packages/openchs-android/node_modules/react-native/Libraries/Core/Timers/JSTimers.js:111:14 _callTimer
    /home/circleci/avni-client/packages/openchs-android/node_modules/react-native/Libraries/Core/Timers/JSTimers.js:359:16 callTimers
    native apply
    /home/circleci/avni-client/packages/openchs-android/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:428:31 __callFunction
    /home/circleci/avni-client/packages/openchs-android/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:25 anonymous
    /home/circleci/avni-client/packages/openchs-android/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:368:10 __guard
    /home/circleci/avni-client/packages/openchs-android/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:16 callFunctionReturnFlushedQueue

Error scenario:

  • Login to avni 7.0 Beta APK as any user where the organisation still uses MyDashboard and not a customDashboard as Primary
  • Now apply address filter and attempt to apply the same for any subjectType
  • App fails on clicking "Apply"
    Note: Error seen for jsscp users in prod env, prod org
@1t5j0y 1t5j0y converted this from a draft issue Mar 8, 2024
@mahalakshme mahalakshme moved this from New Issues to Ready in Avni Product Mar 8, 2024
@himeshr himeshr moved this from Ready to In Progress in Avni Product Mar 11, 2024
@himeshr himeshr self-assigned this Mar 11, 2024
himeshr added a commit that referenced this issue Mar 11, 2024
… in cache as they result in cyclical structure in JSON object
himeshr added a commit that referenced this issue Mar 11, 2024
@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product Mar 11, 2024
@himeshr
Copy link
Contributor

himeshr commented Mar 11, 2024

Test cases:

For myDashboardFilters test the following

  • Set of filters of different types (Address, gender, location, customFilters, name, etc..)
  • save and see that filters are applied
  • Open filters and ensure that applied filters are retained, change the filter and apply again
  • restart app and check that filter is retained for the subjectType
  • change subjectType and see that filters are cleared
  • apply new filters and save
  • filters should get applied
  • open filter and check that applied filters are retained
  • change subjectType and see that all filters are cleared

@petmongrels petmongrels moved this from Code Review Ready to In Code Review in Avni Product Mar 11, 2024
@petmongrels petmongrels moved this from In Code Review to QA Ready in Avni Product Mar 11, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Mar 12, 2024
@AchalaBelokar
Copy link

AchalaBelokar commented Mar 12, 2024

Normal dashboard filter

  • Set filter with program it is working fine
  • After killing the app filters are retained.
  • After killing the app filter are retain also checked
  • Location with program filter
  • Location with different address level
  • Select subject type and apply
  • After killing the app I reopen filter are retained

Custom dashboard

  • location filter
  • Killed app and open the app filters are retained
  • after updating the app still filter are retained

@AchalaBelokar AchalaBelokar moved this from In QA to Test cases review in Avni Product Mar 12, 2024
@mahalakshme mahalakshme moved this from Test cases review to Done in Avni Product Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants