Skip to content

<Feature> <Segregate Master Data and Pre-Registration Sync> US:01 : Implement Segregated Sync UI with "Synchronise Data" and "Download Pre-Registration Data" Buttons #1064

@Varaniya201

Description

@Varaniya201

Description

As an Operator, I want to see two separate buttons on the home dashboard - one labeled "Synchronise Data" for Master Data Sync and one labeled "Download Pre-Registration Data" for Pre-registration Sync - each with independent progress indicators and error handling, So that I can manually trigger and monitor each type of synchronization independently based on my specific needs, understand the exact status of each operation, and know which one failed if there are issues.

Purpose

To provide operators with granular control over sync operations through clear and descriptive button names that explain the purpose of each sync, along with visibility into sync progress and specific error messages for each sync type. This enhancement also addresses the differing sync frequencies, where master data sync occurs infrequently, while pre-registration data is expected to be synced and updated on a daily basis.

Pre-requisites

  • Home dashboard screen is available
  • Network connectivity detection available
  • Application supports localization framework
  • Design system with colors, icons, typography defined
  • Navigation routing system in place

Basic Flow

Step 1: Display Segregated Sync Buttons with Correct Labels

  1. Operator navigates to home dashboard

  2. System displays two separate, prominent action buttons:

    Button 1: "Synchronise Data"

    • Icon: Refresh icon (representing data synchronization)
    • Label: "Synchronise Data"
    • Purpose: Synchronizes master data configuration, templates, and device settings
    • Tooltip: "Download and synchronize master data configuration, document templates, and device settings"
    • Status indicator: Shows "Last synced: 2:30 PM" or "Syncing... 60%"

    Button 2: "Download Pre-Registration Data"

    • Icon: Download icon (representing downloading applicant data)
    • Label: "Download Pre-Registration Data"
    • Purpose: Downloads pre-registered applicant data for offline processing
    • Tooltip: "Download pre-registered applicant data for offline registration processing"
    • Status indicator: Shows "Last downloaded: 2:45 PM" or "Downloading... 35%"
  3. Both buttons arranged vertically in stack (mobile) or horizontally in grid (tablet)

  4. Both buttons initially enabled

Step 2: Handle Button Click - Single Sync Initiation
When Operator Clicks "Synchronise Data":

  1. System initiates ONLY master data sync (not pre-registration)
  2. Button becomes disabled (grayed out)
  3. Progress indicator appears as pop-up showing:
    Synchronise Data
    ████████░░░░░░░ 60%
    Syncing master configuration...
    [Cancel]
    
  4. Screen will be disabled and restrict user to perform any action during the sync
    When Operator Clicks "Download Pre-Registration Data":
  5. System initiates ONLY pre-registration data download (not master data)
  6. Button becomes disabled (grayed out)
  7. Progress indicator appears as pop-up showing:
    Download Pre-Registration Data
    ██░░░░░░░░░░░░░ 35%
    Downloading applicant records...
    [Cancel]
    
  8. Screen will be disabled and restrict user to perform any action during the sync

Step 5: Handle Sync Completion

  1. "Synchronise Data" progress reaches 100%
  2. Success message displays:
    ✓ Synchronise Data completed successfully
    Last synced: 2:30 PM
    Duration: 2 minutes 45 seconds
    
  3. Button state returns to normal (enabled)
  4. Last sync timestamp updated
  5. Button ready for next sync

Step 6: Handle Sync Failure with Specific Error

  1. "Synchronise Data" running (45% complete)
  2. Error occurs (network timeout, server error, etc.)
  3. Progress bar stops at 45%
  4. Error dialog appears specific to Master Data:
    ⚠️ Synchronise Data Failed
    
    Error: Network timeout
    Failed at: Syncing device templates
    Stopped at: 45% complete
    
    The operation timed out after 30 seconds
    while downloading device configuration.
    Please check your internet connection
    and try again.
    
    Synced so far: 1 of 5 data types
    
    [RETRY] [CANCEL] [CONTACT SUPPORT]
    
  5. Operator can [RETRY] to continue from 45% (not restart from 0%)
  6. If Pre-registration was queued:
    ⓘ Pre-registration data download cancelled
      because Synchronise Data failed.
      You can retry pre-registration download manually later.
    

Step 7: Handle Network Loss During Sync (Pause, Not Fail)

  1. "Synchronise Data" running (60% complete)
  2. Network connection lost
  3. Progress bar FREEZES at 60% (doesn't reset)
  4. Message appears:
    ⓘ Network connection lost
    
    Sync paused at 60% complete
    Will automatically resume when 
    connectivity is restored
    
  5. Operator sees button still disabled
  6. Network restored
  7. Dialog appears:
    ✓ Connectivity restored
    
    Resuming Synchronise Data
    from 60%...
    
  8. Sync automatically continues (no user action needed)
  9. Eventually completes from 60% → 100%

Step 8: Display Last Sync Timestamps

  1. When no sync running:
    Synchronise Data
    Last synced: 2:30 PM
    
    Download Pre-Registration Data
    Last synced: 2:45 PM
    
  2. Timestamps persist across app sessions
  3. Timestamps update after each successful sync

Alternate Flows

Alternate Flow A1: Multiple Retry Attempts

  1. "Synchronise Data" fails
  2. Error dialog shown with [RETRY]
  3. First retry fails with same error
  4. Error dialog shown again
  5. Second retry fails
  6. After 3 failed attempts, dialog changes:
    ⚠️ Synchronise Data Failed (Attempt 3)
    
    Multiple retry attempts have failed.
    The issue may be persistent.
    
    Recommendations:
    • Check internet connectivity
    • Verify server is accessible
    • Wait a few minutes and retry
    • Contact support with error details below:
    
    Error: Network timeout at Syncing templates
    Timestamp: 2:45 PM
    Attempt: 3
    
    [CONTACT SUPPORT] [TRY LATER] [BACK]
    

Alternate Flow A2: Pre-registration with No Data

  1. Operator clicks "Download Pre-Registration Data"
  2. Download starts with progress showing
  3. Progress bar fills to 100% immediately (no data to download)
  4. Success message:
    ✓ Pre-registration Data Download completed
    
    No pre-registrations found to download
    Last synced: 2:45 PM
    Duration: 2 seconds
    

Alternate Flow A3: App Backgrounded During Sync

  1. "Synchronise Data" running with progress showing
  2. Operator switches to another app or locks phone
  3. Sync continues in background using foreground service
  4. System shows notification: "Sync in progress: Synchronise Data 60%"
  5. Operator returns to app
  6. Progress is restored showing current state (60%)
  7. Sync completes normally

Alternate Flow A4: Network Changes from WiFi to Mobile Data

  1. "Synchronise Data" running on WiFi (60%)
  2. WiFi drops
  3. Device switches to mobile data
  4. Sync pauses briefly
  5. Resumes automatically on mobile data
  6. Continues to 100%
  7. Message: "Sync continued on mobile data"

Scenarios

Scenario Action Expected Result
S1 Open dashboard Two buttons visible: "Synchronise Data" & "Download Pre-Registration Data"; both enabled
S2 Click "Synchronise Data" Master syncs; button disabled; progress 0%
S3 "Synchronise Data" completes 100% progress; success message; button enabled; timestamp updated
S4 "Synchronise Data" fails at 45% Error dialog specific to sync; shows step and error; offers retry
S5 Click Retry after failure Sync resumes from 45% (not 0%); completes successfully
S6 Network lost during sync Progress freezes; "offline" message; auto-resumes when online
S7 Pre-reg download no data Download runs but completes immediately; message: "No data found"
S8 3 failed retries Error suggests contact support; shows error details

Error Messages

Error Scenario Error Message User Action
Network timeout during Sync "Synchronise Data failed. Network timeout after 30s. Check internet and retry." [RETRY] [CONTACT SUPPORT]
Server error during Sync "Synchronise Data failed. Server returned error. Please try again later." [RETRY] [CONTACT SUPPORT]
Connection lost "Network connection lost. Synchronise Data paused. Will resume when online." Auto-resume (no action)
No internet "No internet connection. Please connect and try again." Retry after connecting
Pre-reg download timeout "Download Pre-Registration Data failed. Timeout while fetching applicant records." [RETRY] [CONTACT SUPPORT]
Pre-reg no data "Download Pre-Registration Data completed. No pre-registrations found." [OK]
Low storage "Synchronise Data failed. Insufficient storage space. Free up space and retry." Free storage & retry

Data Fields

No response

Business Rules (With Audit)

BR-001: Two distinct sync buttons MUST be displayed with exact labels:

  • Button 1: "Synchronise Data" (Master Data Sync)
  • Button 2: "Download Pre-Registration Data" (Pre-registration Sync)

BR-002: "Synchronise Data" button MUST trigger ONLY master data synchronization (templates, devices, configuration)

BR-003: "Download Pre-Registration Data" button MUST trigger ONLY pre-registration data download (applicant records)

BR-004: When one sync is running:

  • Screen should be disabled and restrict the user to perform any action

BR-005: Progress indicators MUST be independent:

  • Master progress updates separately from Pre-reg
  • Each can fail independently without affecting other

BR-006: Sync failure MUST be specific to sync type:

  • Error message MUST indicate which sync failed (using button label)
  • Error MUST specify which step failed
  • Retry MUST continue from failure point, not restart entire sync

BR-008: Network disconnection during sync:

  • MUST NOT be treated as failure (must pause gracefully)
  • Progress MUST freeze at current % (not reset)
  • MUST auto-resume when network restored (no user action)
  • Operator sees "offline" message, not error

BR-009: Last sync timestamp MUST be displayed separately for each type:

  • "Synchronise Data: Last synced at 2:30 PM"
  • "Download Pre-Registration Data: Last downloaded at 2:45 PM"
  • Timestamps MUST persist across app sessions

BR-010: After 3 failed retry attempts:

  • Error message MUST suggest contacting support
  • Error details MUST be provided for troubleshooting

Acceptance Criteria

Criteria Verification Method
Button 1 labeled "Synchronise Data" Visual inspection; verify exact label
Button 2 labeled "Download Pre-Registration Data" Visual inspection; verify exact label
Each button has distinct icon Icons different and appropriate
"Synchronise Data" triggers ONLY master sync Click button; check logs; only master data synced
"Download Pre-Registration Data" triggers ONLY pre-reg Click button; check logs; only pre-reg data downloaded
Progress shown independently for each Two syncs running; each shows separate progress
Last sync timestamp shown separately Dashboard displays different times for each
Error message specific to sync type Trigger error in each; verify message uses button name
Error indicates failed step Check error message shows "Failed at: X"
Retry resumes from failure point Fail at 45%; retry; verify no duplicate data
Network loss pauses (not fails) Disconnect during sync; verify pause, not error
Auto-resume after network restored Restore connection; verify sync continues from last %
Cancel confirmation prevents accidental cancel Click cancel; verify confirmation required
Multiple retries suggest support Fail 3x; verify support suggestion shown
Button states reactive to progress Progress updates; button state changes accordingly
Partial sync data preserved Fail at 45%; check database; data from 0-45% exists

Exceptions

Exception Handling Strategy
Both syncs requested simultaneously Queue second sync; show queued status
Button click while offline Show "Please connect to internet"; disable button
Sync failure Show error with sync type, step, reason; allow retry
Timeout during sync Stop sync; show timeout error; allow retry
User navigates away during sync Continue in background; restore UI on return
App crashes during sync Lose current session; user can retry from start
Invalid API response Log error; show generic error; contact support option
Corrupted downloaded data Log error; show "Invalid data received"; allow retry
Database write error Log error; show "Local storage error"; allow retry
Network changes (WiFi→Mobile) Pause briefly; resume on new connection

Documentation

No response

Reference UX

No response

Compatibility

No response

Implementation Details

TBA

Non-Functional Requirements

Requirement Specification
UI Load Time Dashboard with sync buttons loads in <500ms
Button Response Time Button disables within 100ms of click
Progress Update Frequency UI updates every 500ms with new progress %
Memory Usage Both sync providers use <20MB combined
Battery Impact Uses WorkManager (not continuous polling)
Data Usage No unnecessary duplicate downloads
Localization All text strings support multiple languages
Performance No jank or freezing during sync

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions