Conversation
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
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.