Skip to content

Commit 656d63f

Browse files
eriedclaude
andcommitted
fix(sync): only upload trip CSVs to Dropbox, not every file in the folder
The background DropboxSyncWorker uploaded every file in the local trips dir (listFiles { isFile }), so the Export-all-as-ZIP bundle (trips_export.dbb, ".zip" on older builds) that lives in that same folder leaked into the rider's Dropbox /trips alongside the real trips. Filter to *.csv, matching what SyncManager already does. Existing stray bundles must be deleted from Dropbox by hand (the sync is upload-only and never removes remote files). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GHUZZ33sT9FYS6sXiMogJc
1 parent d8d75a1 commit 656d63f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/src/main/java/com/eried/eucplanet/data/sync/DropboxSyncWorker.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ class DropboxSyncWorker @AssistedInject constructor(
4848
Log.w(TAG, "list_folder failed, will retry")
4949
return Result.retry()
5050
}
51-
val localFiles = tripRepository.getTripsDir().listFiles { f -> f.isFile }
51+
// Only trip CSVs belong in the Dropbox /trips folder. The trips dir also
52+
// holds transient bundles like "trips_export.dbb" (the Export-all-as-ZIP
53+
// share file); without this filter the sync uploaded those too, so a
54+
// "trips_export.zip/.dbb" leaked into the rider's Dropbox alongside the
55+
// real trips.
56+
val localFiles = tripRepository.getTripsDir()
57+
.listFiles { f -> f.isFile && f.name.endsWith(".csv", ignoreCase = true) }
5258
?.toList().orEmpty()
5359
var anyFailed = false
5460
var uploaded = 0

0 commit comments

Comments
 (0)