codecharta
codecharta copied to clipboard
Usage Data Tracking is broken
Bug
Expected Behavior
WHEN experimental features are enabled
THEN a link to download tracking data is visible in the global settings dialog.
Actual Behavior
a link to download tracking data is not visible in the global settings dialog.
Developer Notes
This is caused by the combination of single and multiple mode #2506. So it should be possible to track for multiple maps.
As this is currently broken I will delete the button (a
element in code) in the global settings dialog instead of migrating it for now (#2815).
For easier later reference the download button has this content <i class="fa fa-download"></i>Download anonymous Tracking Data
and does the following:
downloadTrackingData() {
//TODO: this should be removed as soon as we send the data to a server
// Make sure that only file within usageData can be read
const fileChecksum = this.storeService.getState().files[0].file.fileMeta.fileChecksum.replace(/\//g, "")
let trackedMapMetaData = ""
try {
trackedMapMetaData = localStorage.getItem(`${TRACKING_DATA_LOCAL_STORAGE_ELEMENT}/${fileChecksum}-meta`)
} catch {
// ignore, it no events item exists
}
FileDownloader.downloadData(trackedMapMetaData, `${fileChecksum}.tracking.json`)
}
The Tracking has been removed since we do not need it anymore at the moment. If we need it again we can restore it from the version control