mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-07 08:09:01 +02:00
Revert "Send subscription -> salesforce/v1 links to analytics"
This reverts commit 52c02138f9ef8141850e2f8ce16f2bab1e7463b0. GitOrigin-RevId: 022e828a8e41cc73c4087b94d51fa75dbe6cfdb5
This commit is contained in:
@@ -15,9 +15,6 @@ const analyticsEditingSessionsQueue = Queues.getQueue(
|
||||
const analyticsUserPropertiesQueue = Queues.getQueue(
|
||||
'analytics-user-properties'
|
||||
)
|
||||
const analyticsAccountMappingQueue = Queues.getQueue(
|
||||
'analytics-account-mapping'
|
||||
)
|
||||
|
||||
const ONE_MINUTE_MS = 60 * 1000
|
||||
|
||||
@@ -146,55 +143,6 @@ function setUserPropertyForSessionInBackground(session, property, value) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Register mapping between two accounts.
|
||||
*
|
||||
* @param {object} payload - The event payload to send to Analytics
|
||||
* @param {string} payload.source - The type of account linked from
|
||||
* @param {string} payload.sourceId - The ID of the account linked from
|
||||
* @param {string} payload.target - The type of account linked to
|
||||
* @param {string} payload.targetId - The ID of the account linked to
|
||||
* @param {Date} payload.createdAt - The date the mapping was created
|
||||
* @property
|
||||
*/
|
||||
function registerAccountMapping({
|
||||
source,
|
||||
sourceEntity,
|
||||
sourceEntityId,
|
||||
target,
|
||||
targetEntity,
|
||||
targetEntityId,
|
||||
createdAt,
|
||||
}) {
|
||||
Metrics.analyticsQueue.inc({
|
||||
status: 'adding',
|
||||
event_type: 'account-mapping',
|
||||
})
|
||||
|
||||
analyticsAccountMappingQueue
|
||||
.add('account-mapping', {
|
||||
source,
|
||||
sourceEntity,
|
||||
sourceEntityId,
|
||||
target,
|
||||
targetEntity,
|
||||
targetEntityId,
|
||||
createdAt: createdAt ?? new Date(),
|
||||
})
|
||||
.then(() => {
|
||||
Metrics.analyticsQueue.inc({
|
||||
status: 'added',
|
||||
event_type: 'account-mapping',
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
Metrics.analyticsQueue.inc({
|
||||
status: 'error',
|
||||
event_type: 'account-mapping',
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateEditingSession(userId, projectId, countryCode, segmentation) {
|
||||
if (!userId) {
|
||||
return
|
||||
@@ -401,6 +349,5 @@ module.exports = {
|
||||
setUserPropertyForAnalyticsId,
|
||||
updateEditingSession,
|
||||
getIdsFromSession,
|
||||
registerAccountMapping,
|
||||
analyticsIdMiddleware: expressify(analyticsIdMiddleware),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user