Skip to content

HubSpot plugin - handle invalid blog author references - #688

Merged
djohalo2 merged 1 commit into
mainfrom
fix/hubspot-missing-authors
Aug 25, 2026
Merged

HubSpot plugin - handle invalid blog author references#688
djohalo2 merged 1 commit into
mainfrom
fix/hubspot-missing-authors

Conversation

@djohalo2

@djohalo2 djohalo2 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

This pull request gracefully handles invalid blog author references on a post and fallbacks to last updated by. According to HubSpot this shouldn't be possible and they enforce that a blog post must have a valid blog author. However, drafts are also synced and those might not have a valid blog author id.

Changelog

  • Gracefully handles invalid or missing blog author references on a blog post and fallbacks to last updated by.

Testing

  • Validate that triggering a 404 on getting a blog post author should no longer fail the sync, but fallbacks to last updated at (authorName)

Copilot AI lite review requested due to automatic review settings August 24, 2026 07:57
@github-actions github-actions Bot added the Auto submit to Marketplace on merge Submits the plugin to the marketplace after merging label Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the HubSpot plugin’s blog sync to tolerate unexpected invalid/missing blogAuthorId references by treating “author not found” (404) as non-fatal and falling back to HubSpot’s authorName value (last updater) when the linked Blog Author cannot be resolved.

Changes:

  • Extend PluginError to optionally carry an HTTP status code.
  • Include HTTP status in request failures and treat blog-author 404s as “missing author” rather than a hard error.
  • Filter out invalid/missing blogAuthorId values before fetching authors, and ignore any unresolved authors during sync.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
plugins/hubspot/src/PluginError.ts Adds optional status to PluginError for downstream error handling (e.g., 404 detection).
plugins/hubspot/src/api.ts Propagates HTTP status on failed requests; updates fetchBlogAuthor to return undefined on 404 and request archived authors.
plugins/hubspot/src/blog.ts Filters invalid author IDs and safely handles missing authors when building the author ID → name map.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@djohalo2
djohalo2 force-pushed the fix/hubspot-missing-authors branch from cbbd44c to 4b8e2fc Compare August 25, 2026 07:33
@djohalo2
djohalo2 requested a review from elmarburke August 25, 2026 07:35
Comment thread plugins/hubspot/src/blog.ts
@djohalo2
djohalo2 added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 3dd7f3a Aug 25, 2026
11 checks passed
@djohalo2
djohalo2 deleted the fix/hubspot-missing-authors branch August 25, 2026 08:31
@djohalo2
djohalo2 deployed to production August 25, 2026 08:31 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto submit to Marketplace on merge Submits the plugin to the marketplace after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants