Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass site url as context to listSiteSpaces API #2339

Merged
merged 12 commits into from
Jun 14, 2024

Conversation

taranvohra
Copy link
Member

@taranvohra taranvohra commented Jun 12, 2024

This PR fixes the Space switcher for share-links sites. Currently the spaces rendered in the switcher does not have a published URL and breaks navigation. It is done on purpose to avoid leaking share-links. The listSiteSpaces API has support for populating published URLs for site-spaces if the site URL is provided as context to the API.

Copy link

argos-ci bot commented Jun 12, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 3 changed Jun 14, 2024, 4:51 AM

@taranvohra taranvohra merged commit d8a4ecd into main Jun 14, 2024
7 of 8 checks passed
@taranvohra taranvohra deleted the site-url-context-site-spaces branch June 14, 2024 05:10
/**
* Additional site URL that can be used as context to resolve site space published urls
*/
siteUrlContext: string | null,
Copy link
Contributor

Choose a reason for hiding this comment

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

By passing as an arg here it means it'll form part of the cache key so multiple requests with the same orgId/siteId will not be cached:

getSiteSpaces(':orgId', ':siteId', 'https://docs.gitbook.com') => CACHE MISS
getSiteSpaces(':orgId', ':siteId', 'https://docs.gitbook.com/getting-started') => CACHE MISS, even though data is the same

I'm not sure the best solution for it. If we don't include it in the cache key it could mean caching the same content between different share links, but including it will mean effectively no cache.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not good. We have to fix that.

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.

3 participants