# 3. Progress Sync & Conflict Handling — Test Cases

User Type: **Student**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: progress_sync.md — every feature, sub-feature, and rule covered

---

## Test Execution Policy
- Zero tolerance: any deviation from documented behavior = FAILED = bug
- Every bug is immediately logged/reported (Bug ID, feature, sub-feature, expected vs actual, severity) and fixed 100% before the group passes
- Feature group passes only at 100% test pass rate

## Coverage Matrix
| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 3.1 Sync Progress When Back Online | Automatic sync when back online | TC-ST-12-03-001 |
| 3.1 Sync Progress When Back Online | Sync of watch progress | TC-ST-12-03-002 |
| 3.1 Sync Progress When Back Online | Sync of quiz results and grading | TC-ST-12-03-003 |
| 3.1 Sync Progress When Back Online | Sync of flashcard study and mastery | TC-ST-12-03-004 |
| 3.1 Sync Progress When Back Online | Sync of notes and follow-ups | TC-ST-12-03-005 |
| 3.1 Sync Progress When Back Online | Sync status indicator | TC-ST-12-03-006 |
| 3.1 Sync Progress When Back Online | Sync queue (pending items) | TC-ST-12-03-007 |
| 3.1 Sync Progress When Back Online | Sync event logging (started, completed) | TC-ST-12-03-008 |
| 3.1 Sync Progress When Back Online | Audit logging of the sync progress when back online | TC-ST-12-03-009 |
| 3.1 Sync Progress When Back Online | Rule: The sync is automatic when the device is back online. | TC-ST-12-03-001 |
| 3.1 Sync Progress When Back Online | Rule: All offline activity is reconciled with the account. | TC-ST-12-03-002 |
| 3.1 Sync Progress When Back Online | Rule: A sync status indicator is shown while syncing. | TC-ST-12-03-003 |
| 3.1 Sync Progress When Back Online | Rule: The sync queue holds pending items until synced. | TC-ST-12-03-004 |
| 3.1 Sync Progress When Back Online | Rule: Sync events (started, completed) are logged with the account and the timestamp. | TC-ST-12-03-005 |
| 3.1 Sync Progress When Back Online | Rule: The sync progress when back online is audit-logged with the account and the timestamp. | TC-ST-12-03-006 |
| 3.2 Sync Queue Management | Sync queue of pending offline items | TC-ST-12-03-010 |
| 3.2 Sync Queue Management | View pending items and their status | TC-ST-12-03-011 |
| 3.2 Sync Queue Management | Retry a failed sync | TC-ST-12-03-012 |
| 3.2 Sync Queue Management | Queue processed in order when online | TC-ST-12-03-013 |
| 3.2 Sync Queue Management | Notification for items that could not sync | TC-ST-12-03-014 |
| 3.2 Sync Queue Management | Clear the queue after a successful sync | TC-ST-12-03-015 |
| 3.2 Sync Queue Management | Queue event logging (item added, retried, cleared) | TC-ST-12-03-016 |
| 3.2 Sync Queue Management | Audit logging of the sync queue management | TC-ST-12-03-017 |
| 3.2 Sync Queue Management | Rule: The sync queue holds pending offline items. | TC-ST-12-03-010 |
| 3.2 Sync Queue Management | Rule: The queue is processed in order when online. | TC-ST-12-03-011 |
| 3.2 Sync Queue Management | Rule: A failed sync can be retried. | TC-ST-12-03-012 |
| 3.2 Sync Queue Management | Rule: Items that could not sync are notified. | TC-ST-12-03-013 |
| 3.2 Sync Queue Management | Rule: Queue events (item added, retried, cleared) are logged with the account and the timestamp. | TC-ST-12-03-014 |
| 3.2 Sync Queue Management | Rule: The sync queue management is audit-logged with the account and the timestamp. | TC-ST-12-03-015 |
| 3.3 Conflict Resolution | Detect a conflict (offline and online change to the same item) | TC-ST-12-03-018 |
| 3.3 Conflict Resolution | Resolution rule (latest change wins, merge where possible) | TC-ST-12-03-019 |
| 3.3 Conflict Resolution | Inform the Student of a resolved conflict | TC-ST-12-03-020 |
| 3.3 Conflict Resolution | Conflict log (item, resolution, timestamp) | TC-ST-12-03-021 |
| 3.3 Conflict Resolution | View the Student's conflict history | TC-ST-12-03-022 |
| 3.3 Conflict Resolution | Manual review for a conflict (where needed) | TC-ST-12-03-023 |
| 3.3 Conflict Resolution | Conflict event logging (detected, resolved) | TC-ST-12-03-024 |
| 3.3 Conflict Resolution | Audit logging of the conflict resolution | TC-ST-12-03-025 |
| 3.3 Conflict Resolution | Rule: A conflict is detected when offline and online changes touch the same item. | TC-ST-12-03-018 |
| 3.3 Conflict Resolution | Rule: The resolution rule is latest change wins, with a merge where possible. | TC-ST-12-03-019 |
| 3.3 Conflict Resolution | Rule: The Student is informed of a resolved conflict. | TC-ST-12-03-020 |
| 3.3 Conflict Resolution | Rule: A conflict can require manual review. | TC-ST-12-03-021 |
| 3.3 Conflict Resolution | Rule: Conflict events (detected, resolved) are logged with the item and the timestamp. | TC-ST-12-03-022 |
| 3.3 Conflict Resolution | Rule: The conflict resolution is audit-logged with the account, the item, and the timestamp. | TC-ST-12-03-023 |

## 3.1 Sync Progress When Back Online

### TC-ST-12-03-001 — Automatic sync when back online
**Type:** Positive
**Covers:** 3.1 → Automatic sync when back online; Rule: The sync is automatic when the device is back online.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Automatic sync when back online.
2. Observe the result and verify the full behavior: Automatic sync when back online.
**Expected Result:** Automatic sync when back online — delivered exactly as documented.
**Priority:** Critical

### TC-ST-12-03-002 — Sync of watch progress
**Type:** Positive
**Covers:** 3.1 → Sync of watch progress; Rule: All offline activity is reconciled with the account.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Sync of watch progress.
2. Observe the result and verify the full behavior: Sync of watch progress.
**Expected Result:** Sync of watch progress — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-003 — Sync of quiz results and grading
**Type:** Positive
**Covers:** 3.1 → Sync of quiz results and grading; Rule: A sync status indicator is shown while syncing.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Sync of quiz results and grading.
2. Observe the result and verify the full behavior: Sync of quiz results and grading.
**Expected Result:** Sync of quiz results and grading — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-004 — Sync of flashcard study and mastery
**Type:** Positive
**Covers:** 3.1 → Sync of flashcard study and mastery; Rule: The sync queue holds pending items until synced.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Sync of flashcard study and mastery.
2. Observe the result and verify the full behavior: Sync of flashcard study and mastery.
**Expected Result:** Sync of flashcard study and mastery — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-005 — Sync of notes and follow-ups
**Type:** Positive
**Covers:** 3.1 → Sync of notes and follow-ups; Rule: Sync events (started, completed) are logged with the account and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Sync of notes and follow-ups.
2. Observe the result and verify the full behavior: Sync of notes and follow-ups.
**Expected Result:** Sync of notes and follow-ups — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-006 — Sync status indicator
**Type:** Positive
**Covers:** 3.1 → Sync status indicator; Rule: The sync progress when back online is audit-logged with the account and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Sync status indicator.
2. Observe the result and verify the full behavior: Sync status indicator.
**Expected Result:** Sync status indicator — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-007 — Sync queue (pending items)
**Type:** Positive
**Covers:** 3.1 → Sync queue (pending items)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Sync queue (pending items).
2. Observe the result and verify the full behavior: Sync queue (pending items).
**Expected Result:** Sync queue (pending items) — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-008 — Sync event logging (started, completed)
**Type:** Positive
**Covers:** 3.1 → Sync event logging (started, completed)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Sync event logging (started.
2. Observe the result and verify the full behavior: Sync event logging (started, completed).
**Expected Result:** Sync event logging (started, completed) — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-009 — Audit logging of the sync progress when back online
**Type:** Positive
**Covers:** 3.1 → Audit logging of the sync progress when back online
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the sync progress when back online.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 3.2 Sync Queue Management

### TC-ST-12-03-010 — Sync queue of pending offline items
**Type:** Positive
**Covers:** 3.2 → Sync queue of pending offline items; Rule: The sync queue holds pending offline items.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Sync queue of pending offline items.
2. Observe the result and verify the full behavior: Sync queue of pending offline items.
**Expected Result:** Sync queue of pending offline items — delivered exactly as documented.
**Priority:** Critical

### TC-ST-12-03-011 — View pending items and their status
**Type:** Positive
**Covers:** 3.2 → View pending items and their status; Rule: The queue is processed in order when online.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: View pending items and their status.
2. Observe the result and verify the full behavior: View pending items and their status.
**Expected Result:** View pending items and their status — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-012 — Retry a failed sync
**Type:** Positive
**Covers:** 3.2 → Retry a failed sync; Rule: A failed sync can be retried.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Retry a failed sync.
2. Observe the result and verify the full behavior: Retry a failed sync.
**Expected Result:** Retry a failed sync — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-013 — Queue processed in order when online
**Type:** Positive
**Covers:** 3.2 → Queue processed in order when online; Rule: Items that could not sync are notified.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Queue processed in order when online.
2. Observe the result and verify the full behavior: Queue processed in order when online.
**Expected Result:** Queue processed in order when online — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-014 — Notification for items that could not sync
**Type:** Positive
**Covers:** 3.2 → Notification for items that could not sync; Rule: Queue events (item added, retried, cleared) are logged with the account and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Notification for items that could not sync.
2. Observe the result and verify the full behavior: Notification for items that could not sync.
**Expected Result:** Notification for items that could not sync — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-015 — Clear the queue after a successful sync
**Type:** Positive
**Covers:** 3.2 → Clear the queue after a successful sync; Rule: The sync queue management is audit-logged with the account and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Clear the queue after a successful sync.
2. Observe the result and verify the full behavior: Clear the queue after a successful sync.
**Expected Result:** Clear the queue after a successful sync — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-016 — Queue event logging (item added, retried, cleared)
**Type:** Positive
**Covers:** 3.2 → Queue event logging (item added, retried, cleared)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Queue event logging (item added.
2. Observe the result and verify the full behavior: Queue event logging (item added, retried, cleared).
**Expected Result:** Queue event logging (item added, retried, cleared) — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-017 — Audit logging of the sync queue management
**Type:** Positive
**Covers:** 3.2 → Audit logging of the sync queue management
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the sync queue management.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 3.3 Conflict Resolution

### TC-ST-12-03-018 — Detect a conflict (offline and online change to the same item)
**Type:** Positive
**Covers:** 3.3 → Detect a conflict (offline and online change to the same item); Rule: A conflict is detected when offline and online changes touch the same item.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Detect a conflict (offline and online change to the same item).
2. Observe the result and verify the full behavior: Detect a conflict (offline and online change to the same item).
**Expected Result:** Detect a conflict (offline and online change to the same item) — delivered exactly as documented.
**Priority:** Critical

### TC-ST-12-03-019 — Resolution rule (latest change wins, merge where possible)
**Type:** Positive
**Covers:** 3.3 → Resolution rule (latest change wins, merge where possible); Rule: The resolution rule is latest change wins, with a merge where possible.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Resolution rule (latest change wins.
2. Observe the result and verify the full behavior: Resolution rule (latest change wins, merge where possible).
**Expected Result:** Resolution rule (latest change wins, merge where possible) — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-020 — Inform the Student of a resolved conflict
**Type:** Positive
**Covers:** 3.3 → Inform the Student of a resolved conflict; Rule: The Student is informed of a resolved conflict.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Inform the Student of a resolved conflict.
2. Observe the result and verify the full behavior: Inform the Student of a resolved conflict.
**Expected Result:** Inform the Student of a resolved conflict — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-021 — Conflict log (item, resolution, timestamp)
**Type:** Positive
**Covers:** 3.3 → Conflict log (item, resolution, timestamp); Rule: A conflict can require manual review.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Conflict log (item.
2. Observe the result and verify the full behavior: Conflict log (item, resolution, timestamp).
**Expected Result:** Conflict log (item, resolution, timestamp) — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-022 — View the Student's conflict history
**Type:** Positive
**Covers:** 3.3 → View the Student's conflict history; Rule: Conflict events (detected, resolved) are logged with the item and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: View the Student's conflict history.
2. Observe the result and verify the full behavior: View the Student's conflict history.
**Expected Result:** View the Student's conflict history — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-023 — Manual review for a conflict (where needed)
**Type:** Positive
**Covers:** 3.3 → Manual review for a conflict (where needed); Rule: The conflict resolution is audit-logged with the account, the item, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Manual review for a conflict (where needed).
2. Observe the result and verify the full behavior: Manual review for a conflict (where needed).
**Expected Result:** Manual review for a conflict (where needed) — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-024 — Conflict event logging (detected, resolved)
**Type:** Positive
**Covers:** 3.3 → Conflict event logging (detected, resolved)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Conflict event logging (detected.
2. Observe the result and verify the full behavior: Conflict event logging (detected, resolved).
**Expected Result:** Conflict event logging (detected, resolved) — delivered exactly as documented.
**Priority:** High

### TC-ST-12-03-025 — Audit logging of the conflict resolution
**Type:** Positive
**Covers:** 3.3 → Audit logging of the conflict resolution
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the conflict resolution.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical
