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

fix: Add AtClientException in SyncProgress and return exception on invalid sync regex #1052

Merged
merged 8 commits into from
Jun 6, 2023

Conversation

sitaram-kalluri
Copy link
Member

@sitaram-kalluri sitaram-kalluri commented May 31, 2023

- What I did
fix: Add AtClientException in SyncProgress and return exception on invalid sync regex

  • When an invalid regex is supplied to the AtClientPreferences, the sync service fails to fetch the localCommitId. In at_persistence_secondary_server, "AtCommitLog.lastSyncedEntryWithRegex" returns an FormatException when trying to fetch the lastSyncedEntry with regex, but the exception is not propagated to apps. Since the sync service is unable to fetch the localCommitId, it enters into an infinite loop but the underlying reason is unknown to the apps.

  • Removed the tearDown method in notify_test.dart which removes the KeyStore files after the notify test and as a result the subsequent tests will have to perform the initial sync.

  • Removed the imports from following files that cause warnings in the dart analyze

    • at_client_impl.dart
    • at_client_manager.dart
    • at_client_impl_test.dart
    • no_op_services.dart

- How I did it

  • In the sync progress, Introduce AtClientException.
  • When fetching localCommitId, if a FormatException arises, catch the exception and populate the AtClientException in the SyncProgress and inform the apps.

- How to verify it

  • Added a unit test to assert the changes.

- Description for the changelog

  • Return AtClientException from sync service when an invalid regex is supplied in the AtClientPreferences.

@gkc
Copy link
Contributor

gkc commented Jun 5, 2023

@sitaram-kalluri this PR's branch has git conflicts that need to be resolved

@sitaram-kalluri
Copy link
Member Author

@sitaram-kalluri this PR's branch has git conflicts that need to be resolved

Sure Gary, will resolve it and keep you updated.

@sitaram-kalluri
Copy link
Member Author

@gkc: Resolved the merge conflicts. Please review.

@gkc gkc changed the title fix: Add AtClientException in SyncProgress and return exception on in… fix: Add AtClientException in SyncProgress and return exception on invalid sync regex Jun 6, 2023
@sitaram-kalluri sitaram-kalluri merged commit c43dada into trunk Jun 6, 2023
6 checks passed
@sitaram-kalluri sitaram-kalluri deleted the invalid_sync_regex branch June 12, 2023 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants