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

Fastsync locale mapping issue #1552

Closed
Tracked by #1671
mahalakshme opened this issue Dec 2, 2024 · 1 comment
Closed
Tracked by #1671

Fastsync locale mapping issue #1552

mahalakshme opened this issue Dec 2, 2024 · 1 comment
Assignees

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Dec 2, 2024

https://avni.freshdesk.com/a/tickets/4969

Steps to reproduce the issue:

  • login as sujatha@yenepoya
  • when it tries to do fast sync - you will see the error Exception in HostFunction: Accessing object of type LocaleMapping which has been invalidated or deleted
    Note: Users are unblocked by slow sync

Stacktrace:

12-02 14:13:31.787  5650  5693 I ReactNativeJS: 'Should compact', 84471808, 83421064, false
12-02 14:13:31.796  5650  5693 I ReactNativeJS: '[AvniModels.Schema]', 'Running migration with old schema version: 186 and new schema version: 197'
12-02 14:13:31.810  5650  5693 D ReactNativeJS: '[2:13:31:810] [BackupRestoreRealmService][Debug]', 'Removing downloaded files'
12-02 14:13:31.810  5650  5693 D ReactNativeJS: '[2:13:31:810] [LoginView][Debug]', 'onLoginProgress restoringDb'
12-02 14:13:31.810  5650  5693 D ReactNativeJS: '[2:13:31:810] [LoginView::AC][Debug]', 'Dispatching action: "LA.ON_DUMP_RESTORING"'
12-02 14:13:31.811  5650  5693 D ReactNativeJS: '[2:13:31:811] [LoginView][Debug]', 'render'
12-02 14:13:31.817  5650  5693 D ReactNativeJS: '[2:13:31:817] [LoginView::AC][Debug]', 'Dispatched action completed: "LA.ON_DUMP_RESTORING" {"loggedInUser":undefined,"userId":"sujatha@yenepoya","password":"password","showPassword":true,"loggingIn":false,"loginError":"","loginSuccess":false,"validationResult":{"success":true,"formIdentifier":undefined,"messageKey":undefined,"extra":undefined,"questionGroupIndex":undefined,"validationType":"Form"},"dumpRestoring":true,"percentProgress":94,"dumpRestoreMessage":"restoringDb","idpType":"cognito","userSelectedIdp":"keycloak"}'
12-02 14:13:31.858  5650  5693 D ReactNativeJS: '[2:13:31:858] [EntitySyncStatusService][Debug]', 'Setting up base entity sync status for RuleFailureTelemetry'
12-02 14:13:31.873  5650  5693 D ReactNativeJS: '[2:13:31:873] [BackupRestoreRealmService][Debug]', 'Personalising database'
12-02 14:13:31.873  5650  5693 D ReactNativeJS: '[2:13:31:873] [LoginView][Debug]', 'onLoginProgress restoringDb'
12-02 14:13:31.873  5650  5693 D ReactNativeJS: '[2:13:31:873] [LoginView::AC][Debug]', 'Dispatching action: "LA.ON_DUMP_RESTORING"'
12-02 14:13:31.874  5650  5693 D ReactNativeJS: '[2:13:31:874] [LoginView][Debug]', 'render'
12-02 14:13:31.882  5650  5693 D ReactNativeJS: '[2:13:31:882] [LoginView::AC][Debug]', 'Dispatched action completed: "LA.ON_DUMP_RESTORING" {"loggedInUser":undefined,"userId":"sujatha@yenepoya","password":"password","showPassword":true,"loggingIn":false,"loginError":"","loginSuccess":false,"validationResult":{"success":true,"formIdentifier":undefined,"messageKey":undefined,"extra":undefined,"questionGroupIndex":undefined,"validationType":"Form"},"dumpRestoring":true,"percentProgress":97,"dumpRestoreMessage":"restoringDb","idpType":"cognito","userSelectedIdp":"keycloak"}'
12-02 14:13:31.912  5650  5693 I ReactNativeJS: '[BackupRestoreRealm]', 'Exception in HostFunction: Accessing object of type LocaleMapping which has been invalidated or deleted', '{}'
12-02 14:15:23.718  5932  5975 I ReactNativeJS: Running "Avni
12-02 14:15:23.878  5932  5975 W ReactNativeJS: `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
12-02 14:15:23.878  5932  5975 W ReactNativeJS: `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.

Technical analysis:

  • Issue has happened around here
    when trying to restore settings, but when we don't anymore have the older locale mapping object
  • It is from UserInfo table, locale setting is used and not from Settings table, and hence the developer can decide to remove the column after making sure about absence of its usages.

AC:

  • Find out how other fast syncs were not failing all these time and only this is failing
  • The above issue should never reoccur
@mahalakshme mahalakshme converted this from a draft issue Dec 2, 2024
@mahalakshme mahalakshme moved this from In Analysis to Ready in Avni Product Dec 2, 2024
@himeshr himeshr moved this from Ready to In Progress in Avni Product Dec 3, 2024
@himeshr himeshr self-assigned this Dec 3, 2024
himeshr added a commit that referenced this issue Dec 6, 2024
…o avoid issues with re-login with different org user
@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product Dec 6, 2024
@himeshr
Copy link
Contributor

himeshr commented Dec 6, 2024

Notes

  • It is from UserInfo table, locale setting is used and not from Settings table, and hence the developer can decide to remove the column after making sure about absence of its usages. => We store the selected locale in userInfo, but have a link to all Org allowed Locale infor from Settings.locale

  • First time fast-sync done after app install does not fail, the issue happens only when we do reset sync by clearing data and then we attempt to perform Fast sync

@petmongrels petmongrels moved this from Code Review Ready to In Code Review in Avni Product Dec 9, 2024
@petmongrels petmongrels moved this from In Code Review to QA Ready in Avni Product Dec 9, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Dec 10, 2024
@AchalaBelokar AchalaBelokar moved this from In QA to Done in Avni Product Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants