codecharta icon indicating copy to clipboard operation
codecharta copied to clipboard

Usage Data Tracking is broken

Open ce-bo opened this issue 3 years ago • 2 comments

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.

ce-bo avatar Feb 09 '22 16:02 ce-bo

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`)
}

shaman-apprentice avatar May 22 '22 12:05 shaman-apprentice

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

ce-bo avatar Aug 12 '22 07:08 ce-bo