Skip to content

fix(hubspot): address design root as %252F in metadata calls - #17

Merged
jhd3197 merged 1 commit into
mainfrom
dev
Aug 3, 2026
Merged

fix(hubspot): address design root as %252F in metadata calls#17
jhd3197 merged 1 commit into
mainfrom
dev

Conversation

@jhd3197

@jhd3197 jhd3197 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

HubSpot's edge now rejects /cms/v3/source-code/{env}/metadata/ (empty path) and single-encoded %2F with a bare Jetty 404 before auth, so connect always failed with 'hubspot draft metadata probe failed (404)' regardless of token validity. The root's path parameter must arrive double-encoded as %252F.

  • probe the root via metadata/%252F at connect (401/403 messages kept)
  • metadata() special-cases the empty root path the same way
  • mock decodes %252F back to the root for the roundtrip test

HubSpot's edge now rejects /cms/v3/source-code/{env}/metadata/ (empty
path) and single-encoded %2F with a bare Jetty 404 before auth, so
connect always failed with 'hubspot draft metadata probe failed (404)'
regardless of token validity. The root's path parameter must arrive
double-encoded as %252F.

- probe the root via metadata/%252F at connect (401/403 messages kept)
- metadata() special-cases the empty root path the same way
- mock decodes %252F back to the root for the roundtrip test
Copilot AI review requested due to automatic review settings August 3, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes HubSpot “design root” metadata calls by addressing the root path parameter as double-encoded %252F, avoiding HubSpot edge behavior that returns a Jetty 404 for both metadata/ (empty segment) and single-encoded %2F before authentication. This ensures connect-time validation and root browsing work reliably and still surface the existing actionable 401/403 errors for bad tokens/scopes.

Changes:

  • Special-case the empty root path in HubSpotSession::metadata() to call .../metadata/%252F.
  • Update hubspot_connect() connect-time probe to use .../metadata/%252F (instead of .../metadata/).
  • Update the HubSpot mock router to decode %252F%2F → root, keeping the roundtrip test aligned.

Reviewed changes

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

File Description
src-tauri/tests/hubspot_mock.py Decodes the double-encoded root (%252F) back to the mock’s root representation for routing.
src-tauri/src/session/hubspot.rs Uses %252F for root metadata in both connect-time probe and metadata() when path is empty.
docs/plans/20_hubspot-backend.md Updates the plan documentation to reflect the root probe’s %252F requirement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jhd3197
jhd3197 merged commit 82fce7d into main Aug 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants