Merge pull request #6056 from overleaf/msm-remove-unnecessary-pdf-event-tracking

Cleanup PDF Preview event tracking

GitOrigin-RevId: 8fadaee2759f60e70e27ac417593d35cc73e8b68
This commit is contained in:
Timothée Alby
2021-12-22 09:03:27 +00:00
committed by Copybot
parent f4ea3ae4f8
commit 645132c53b
4 changed files with 1 additions and 27 deletions
@@ -1,6 +1,5 @@
import { isMainFile } from './editor-files'
import getMeta from '../../../utils/meta'
import { sendMBSampled } from '../../../infrastructure/event-tracking'
import { deleteJSON, postJSON } from '../../../infrastructure/fetch-json'
import { debounce } from 'lodash'
import { trackPdfDownload } from '../../../ide/pdf/controllers/PdfJsMetrics'
@@ -74,9 +73,6 @@ export default class DocumentCompiler {
}
try {
// log a sample of the compile requests
sendMBSampled('editor-recompile-sampled', options)
// reset values
this.setChangedAt(0)
this.validationIssues = undefined
@@ -244,9 +244,6 @@ App.controller(
autoCompileIfReady()
}
localStorage(`autocompile_enabled:${$scope.project_id}`, newValue)
eventTracking.sendMB('autocompile-setting-changed', {
value: newValue,
})
}
})
@@ -472,9 +469,6 @@ App.controller(
$scope.pdf.view = 'errors'
$scope.pdf.autoCompileDisabled = true
$scope.autocompile_enabled = false // disable any further autocompiles
eventTracking.sendMB('autocompile-rate-limited', {
hasPremiumCompile: $scope.hasPremiumCompile,
})
}
} else if (response.status === 'project-too-large') {
$scope.pdf.view = 'errors'
@@ -785,8 +779,6 @@ App.controller(
return
}
eventTracking.sendMBSampled('editor-recompile-sampled', options)
$scope.lastStartedCompileAt = Date.now()
$scope.pdf.compiling = true
$scope.pdf.isAutoCompileOnLoad =
@@ -959,7 +951,6 @@ App.controller(
$scope.openInEditor = function (entry) {
let column, line
eventTracking.sendMBOnce('logs-jump-to-location-once')
const entity = ide.fileTreeManager.findEntityByPath(entry.file)
if (entity == null || entity.type !== 'doc') {
return
@@ -1,5 +1,4 @@
import App from '../../../base'
import { sendMBOnce } from '../../../infrastructure/event-tracking'
App.controller('PdfSynctexController', function ($scope, synctex, ide) {
this.cursorPosition = null
@@ -50,8 +49,6 @@ App.controller('PdfSynctexController', function ($scope, synctex, ide) {
})
window.addEventListener('synctex:sync-to-entry', event => {
sendMBOnce('logs-jump-to-location-once')
const entry = event.detail
const entity = ide.fileTreeManager.findEntityByPath(entry.file)
@@ -134,7 +134,7 @@ export function CompileProvider({ children }) {
const [position, setPosition] = usePersistedState(`pdf.position.${projectId}`)
// whether autocompile is switched on
const [autoCompile, _setAutoCompile] = usePersistedState(
const [autoCompile, setAutoCompile] = usePersistedState(
`autocompile_enabled:${projectId}`,
false,
true
@@ -202,15 +202,6 @@ export function CompileProvider({ children }) {
}
}, [setUncompiled, changedAt])
// record changes to the autocompile setting
const setAutoCompile = useCallback(
value => {
_setAutoCompile(value)
sendMB('autocompile-setting-changed', { value })
},
[_setAutoCompile]
)
// always compile the PDF once after opening the project, after the doc has loaded
useEffect(() => {
if (!compiledOnce && currentDoc) {
@@ -293,7 +284,6 @@ export function CompileProvider({ children }) {
if (!data.options.isAutoCompileOnLoad) {
setError('autocompile-disabled')
setAutoCompile(false)
sendMB('autocompile-rate-limited', { hasPremiumCompile })
}
break