Skip to content

Commit

Permalink
Rename field to lastSentDay
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanKingston committed Oct 26, 2023
1 parent 21c2df2 commit 2a9d7ce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions shared/js/background/broken-site-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const requestCategoryMapping = {
'ignore-user': 'ignoredByUserRequests'
}

function computeSeenBeforeDay (urlString) {
function computeLastSentDay (urlString) {
const url = new URL(urlString)
const time = new Date()
// Round time to nearest day
Expand All @@ -97,13 +97,13 @@ function computeSeenBeforeDay (urlString) {
const dayOutput = time.toISOString().split('T')[0]

const reportTimes = settings.getSetting('brokenSiteReportTimes') || {}
const seenBeforeTime = reportTimes[url.hostname]
const lastSentDay = reportTimes[url.hostname]

// Update existing time
reportTimes[url.hostname] = dayOutput
settings.updateSetting('brokenSiteReportTimes', reportTimes)

return seenBeforeTime
return lastSentDay
}

/**
Expand Down Expand Up @@ -155,7 +155,7 @@ export function breakageReportForTab ({
const debugFlags = tab.debugFlags.join(',')
const errorDescriptions = JSON.stringify(tab.errorDescriptions)
const httpErrorCodes = tab.httpErrorCodes.join(',')
const seenBeforeDay = computeSeenBeforeDay(tab.url)
const lastSentDay = computeLastSentDay(tab.url)

const brokenSiteParams = new URLSearchParams({
siteUrl,
Expand All @@ -173,7 +173,7 @@ export function breakageReportForTab ({
brokenSiteParams.append(key, value.join(','))
}

if (seenBeforeDay) brokenSiteParams.set('seenBeforeDay', seenBeforeDay)
if (lastSentDay) brokenSiteParams.set('lastSentDay', lastSentDay)
if (ampUrl) brokenSiteParams.set('ampUrl', ampUrl)
if (category) brokenSiteParams.set('category', category)
if (debugFlags) brokenSiteParams.set('debugFlags', debugFlags)
Expand Down

0 comments on commit 2a9d7ce

Please sign in to comment.