Skip to content

HubSpot plugin - handle invalid blog author references - #688

Open
djohalo2 wants to merge 1 commit into
mainfrom
fix/hubspot-missing-authors
Open

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

Conversation

@djohalo2

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, #687 surfaced that for at least one user this data integrity is not guaranteed and a 404 could happen.

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.

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.

2 participants