Fix SaveCurrentTrackTask GPX write and error reporting#25198
Conversation
35736f4 to
f6f9e99
Compare
|
This fixes the core bug of writing the wrong The task should return/set the actual saved output file path for the callback flow, or the callers need to be updated to use the saved file(s). Also |
collectRecordedData() returns per-file GpxFile instances but the task always wrote the constructor gpx. Write failures were ignored and onSaveGpxFinished(null) was always called. Write each map entry, use mkdirs(), and propagate the first IOException to SaveGpxListener. Related to osmandapp#25076.
Co-authored-by: Cursor <cursoragent@cursor.com>
f6f9e99 to
a4d415f
Compare
|
Updated: SaveResult now sets gpx.setPath(savedPath) before onSaveGpxFinished(), then clears path only for cache-dir saves after the callback (share/export flow). |
|
The error propagation is a good fix, but this version introduces a couple of regressions.
Also, when the input I think this task should either write the passed |
Summary
GpxFilefromcollectRecordedData()instead of always writing the task constructor instanceSaveGpxListener.onSaveGpxFinished(Exception)mkdirs()for the target directoryRelated issues
#25076 (silent save failure when finishing track recording)
Test plan