refactor(sync): remove dead Backfill/IncrementalSync exported wrappers
Both were only reachable via the periodic background sync loop removed
in 4d2cbe4 -- nothing in production calls them anymore, only tests did.
FullSync already calls backfillCore/incrementalSyncCore directly.
Rewrite the affected tests to call the *Core functions (still exported
within the package) instead, dropping the now-redundant standalone
SyncRun-recording assertion covered by TestFullSync_RecordsOneCombinedSyncRun.
This commit is contained in:
@@ -137,7 +137,7 @@ func TestIsolation_SyncStateAndRunsNeverLeakAcrossUsers(t *testing.T) {
|
||||
t.Fatalf("userA's UpdateSyncState leaked into userB's sync_state: %+v", stateB)
|
||||
}
|
||||
|
||||
runID, err := db.StartSyncRun(ctx, userA, SyncKindBackfill)
|
||||
runID, err := db.StartSyncRun(ctx, userA, SyncKindFull)
|
||||
if err != nil {
|
||||
t.Fatalf("StartSyncRun(a): %v", err)
|
||||
}
|
||||
|
||||
@@ -7,12 +7,10 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
SyncKindBackfill = "backfill"
|
||||
SyncKindIncremental = "incremental"
|
||||
// SyncKindFull is a manually-triggered "Sync now" pass: Backfill followed
|
||||
// by IncrementalSync followed by FillPendingDetails, recorded as one run
|
||||
// so the reported activity count covers the whole action instead of only
|
||||
// whichever stage happened to finish last.
|
||||
// SyncKindFull is a manually-triggered "Sync now" pass: backfillCore
|
||||
// followed by incrementalSyncCore followed by FillPendingDetails,
|
||||
// recorded as one run so the reported activity count covers the whole
|
||||
// action instead of only whichever stage happened to finish last.
|
||||
SyncKindFull = "full"
|
||||
|
||||
SyncStatusRunning = "running"
|
||||
|
||||
@@ -126,7 +126,7 @@ func TestDeleteUser_RemovesUserAndCascadesEverything(t *testing.T) {
|
||||
if err := db.UpdateSyncState(ctx, userID, "2020-01-01", true); err != nil {
|
||||
t.Fatalf("UpdateSyncState: %v", err)
|
||||
}
|
||||
if _, err := db.StartSyncRun(ctx, userID, SyncKindBackfill); err != nil {
|
||||
if _, err := db.StartSyncRun(ctx, userID, SyncKindFull); err != nil {
|
||||
t.Fatalf("StartSyncRun: %v", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user