Skip to content

SyncManager throws "there is already a sync with name" error after re-login #434

@abhinavRepo26

Description

@abhinavRepo26

Description:
When a user logs out and logs back into the app, attempting to create syncs with the same names fails with the error:
com.salesforce.androidsdk.mobilesync.manager.SyncManager$MobileSyncException: Failed to create sync down: there is already a sync with name: [SyncName]

Expected Behavior:

  1. Sync definitions should be cleared/cleaned up during logout
  2. OR SyncManager should handle re-registration of syncs with same names after re-login
  3. OR Provide a clean API to reset sync state for a new user session

Actual Behavior:
Old sync definitions persist in SmartStore's synces soup across user sessions, causing conflicts when trying to create new syncs with identical names.

Reproduction Steps:

  1. Login as User A
  2. Create syncs (e.g., VisitSyncDown, NotificationSyncDown)
  3. Logout
  4. Login as User B (or same user)
  5. Attempt to create syncs with same names
  6. Error occurs

Environment:

  • React Native Salesforce Mobile SDK: 13.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions