-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
/** | ||
* Additional site URL that can be used as context to resolve site space published urls | ||
*/ | ||
siteUrlContext: string | null, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 ascontext
to the API.