Jelajahi Sumber

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

Cleanup PDF Preview event tracking

GitOrigin-RevId: 8fadaee2759f60e70e27ac417593d35cc73e8b68
Timothée Alby 4 tahun lalu
induk
melakukan
b11d4b002c

+ 0 - 4
services/web/frontend/js/features/pdf-preview/util/compiler.js

@@ -1,6 +1,5 @@
 import { isMainFile } from './editor-files'
 import { isMainFile } from './editor-files'
 import getMeta from '../../../utils/meta'
 import getMeta from '../../../utils/meta'
-import { sendMBSampled } from '../../../infrastructure/event-tracking'
 import { deleteJSON, postJSON } from '../../../infrastructure/fetch-json'
 import { deleteJSON, postJSON } from '../../../infrastructure/fetch-json'
 import { debounce } from 'lodash'
 import { debounce } from 'lodash'
 import { trackPdfDownload } from '../../../ide/pdf/controllers/PdfJsMetrics'
 import { trackPdfDownload } from '../../../ide/pdf/controllers/PdfJsMetrics'
@@ -74,9 +73,6 @@ export default class DocumentCompiler {
     }
     }
 
 
     try {
     try {
-      // log a sample of the compile requests
-      sendMBSampled('editor-recompile-sampled', options)
-
       // reset values
       // reset values
       this.setChangedAt(0)
       this.setChangedAt(0)
       this.validationIssues = undefined
       this.validationIssues = undefined

+ 0 - 9
services/web/frontend/js/ide/pdf/controllers/PdfController.js

@@ -244,9 +244,6 @@ App.controller(
           autoCompileIfReady()
           autoCompileIfReady()
         }
         }
         localStorage(`autocompile_enabled:${$scope.project_id}`, newValue)
         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.view = 'errors'
           $scope.pdf.autoCompileDisabled = true
           $scope.pdf.autoCompileDisabled = true
           $scope.autocompile_enabled = false // disable any further autocompiles
           $scope.autocompile_enabled = false // disable any further autocompiles
-          eventTracking.sendMB('autocompile-rate-limited', {
-            hasPremiumCompile: $scope.hasPremiumCompile,
-          })
         }
         }
       } else if (response.status === 'project-too-large') {
       } else if (response.status === 'project-too-large') {
         $scope.pdf.view = 'errors'
         $scope.pdf.view = 'errors'
@@ -785,8 +779,6 @@ App.controller(
         return
         return
       }
       }
 
 
-      eventTracking.sendMBSampled('editor-recompile-sampled', options)
-
       $scope.lastStartedCompileAt = Date.now()
       $scope.lastStartedCompileAt = Date.now()
       $scope.pdf.compiling = true
       $scope.pdf.compiling = true
       $scope.pdf.isAutoCompileOnLoad =
       $scope.pdf.isAutoCompileOnLoad =
@@ -959,7 +951,6 @@ App.controller(
 
 
     $scope.openInEditor = function (entry) {
     $scope.openInEditor = function (entry) {
       let column, line
       let column, line
-      eventTracking.sendMBOnce('logs-jump-to-location-once')
       const entity = ide.fileTreeManager.findEntityByPath(entry.file)
       const entity = ide.fileTreeManager.findEntityByPath(entry.file)
       if (entity == null || entity.type !== 'doc') {
       if (entity == null || entity.type !== 'doc') {
         return
         return

+ 0 - 3
services/web/frontend/js/ide/pdf/controllers/PdfSynctexController.js

@@ -1,5 +1,4 @@
 import App from '../../../base'
 import App from '../../../base'
-import { sendMBOnce } from '../../../infrastructure/event-tracking'
 
 
 App.controller('PdfSynctexController', function ($scope, synctex, ide) {
 App.controller('PdfSynctexController', function ($scope, synctex, ide) {
   this.cursorPosition = null
   this.cursorPosition = null
@@ -50,8 +49,6 @@ App.controller('PdfSynctexController', function ($scope, synctex, ide) {
   })
   })
 
 
   window.addEventListener('synctex:sync-to-entry', event => {
   window.addEventListener('synctex:sync-to-entry', event => {
-    sendMBOnce('logs-jump-to-location-once')
-
     const entry = event.detail
     const entry = event.detail
 
 
     const entity = ide.fileTreeManager.findEntityByPath(entry.file)
     const entity = ide.fileTreeManager.findEntityByPath(entry.file)

+ 1 - 11
services/web/frontend/js/shared/context/compile-context.js

@@ -134,7 +134,7 @@ export function CompileProvider({ children }) {
   const [position, setPosition] = usePersistedState(`pdf.position.${projectId}`)
   const [position, setPosition] = usePersistedState(`pdf.position.${projectId}`)
 
 
   // whether autocompile is switched on
   // whether autocompile is switched on
-  const [autoCompile, _setAutoCompile] = usePersistedState(
+  const [autoCompile, setAutoCompile] = usePersistedState(
     `autocompile_enabled:${projectId}`,
     `autocompile_enabled:${projectId}`,
     false,
     false,
     true
     true
@@ -202,15 +202,6 @@ export function CompileProvider({ children }) {
     }
     }
   }, [setUncompiled, changedAt])
   }, [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
   // always compile the PDF once after opening the project, after the doc has loaded
   useEffect(() => {
   useEffect(() => {
     if (!compiledOnce && currentDoc) {
     if (!compiledOnce && currentDoc) {
@@ -293,7 +284,6 @@ export function CompileProvider({ children }) {
           if (!data.options.isAutoCompileOnLoad) {
           if (!data.options.isAutoCompileOnLoad) {
             setError('autocompile-disabled')
             setError('autocompile-disabled')
             setAutoCompile(false)
             setAutoCompile(false)
-            sendMB('autocompile-rate-limited', { hasPremiumCompile })
           }
           }
           break
           break