Home / Function/ updateTimestampsWithChecksumMatch() — supabase Function Reference

updateTimestampsWithChecksumMatch() — supabase Function Reference

Architecture documentation for the updateTimestampsWithChecksumMatch() function in last-changed.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  bfa6040a_06bc_52d3_f5eb_be9bce7bd5d0["updateTimestampsWithChecksumMatch()"]
  c4ba6037_4ea4_e34c_3bed_9d9cf63274e8["updateTimestamps()"]
  c4ba6037_4ea4_e34c_3bed_9d9cf63274e8 -->|calls| bfa6040a_06bc_52d3_f5eb_be9bce7bd5d0
  141368a9_8f24_1698_ef6b_96859cfb64fa["getContentDirParentPage()"]
  bfa6040a_06bc_52d3_f5eb_be9bce7bd5d0 -->|calls| 141368a9_8f24_1698_ef6b_96859cfb64fa
  1ba60220_a575_c24f_fe49_f47078e3f7a2["getGitUpdatedAt()"]
  bfa6040a_06bc_52d3_f5eb_be9bce7bd5d0 -->|calls| 1ba60220_a575_c24f_fe49_f47078e3f7a2
  style bfa6040a_06bc_52d3_f5eb_be9bce7bd5d0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/scripts/last-changed.ts lines 249–279

async function updateTimestampsWithChecksumMatch(
  filePath: string,
  section: SectionWithChecksum,
  timestamp: Date,
  ctx: Ctx
) {
  const parentPage = getContentDirParentPage(filePath)

  try {
    const gitUpdatedAt = await getGitUpdatedAt(filePath, ctx)

    const { data, error } = await ctx.supabase.rpc('update_last_changed_checksum', {
      new_parent_page: parentPage,
      new_heading: section.heading,
      new_checksum: section.checksum,
      git_update_time: gitUpdatedAt,
      check_time: timestamp,
    })
    if (error) {
      throw Error(error.message || 'Error running function to update checksum')
    }
    if (timestamp.toISOString() === new Date(data ?? null).toISOString()) {
      ctx.stats.sectionsUpdated++
    }
  } catch (err) {
    console.error(
      `Failed to update timestamp with checksum for section ${parentPage}:${section.heading}:\n${err}`
    )
    ctx.stats.sectionsErrored++
  }
}

Subdomains

Called By

Frequently Asked Questions

What does updateTimestampsWithChecksumMatch() do?
updateTimestampsWithChecksumMatch() is a function in the supabase codebase.
What does updateTimestampsWithChecksumMatch() call?
updateTimestampsWithChecksumMatch() calls 2 function(s): getContentDirParentPage, getGitUpdatedAt.
What calls updateTimestampsWithChecksumMatch()?
updateTimestampsWithChecksumMatch() is called by 1 function(s): updateTimestamps.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free