Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix saved searches and prompts list page for anon users#63961

Merged
sqs merged 1 commit into
mainfrom
sqs/affiliated-namespaces-anon-dotcom
Jul 19, 2024
Merged

fix saved searches and prompts list page for anon users#63961
sqs merged 1 commit into
mainfrom
sqs/affiliated-namespaces-anon-dotcom

Conversation

@sqs

@sqs sqs commented Jul 19, 2024

Copy link
Copy Markdown
Member

Anonymous visitors to Sourcegraph.com were unable to list all public saved searches (at https://sourcegraph.com/saved-searches) and prompts (at https://sourcegraph.com/prompts) for 2 reasons:

  1. The namespace selector (filter) was broken for anonymous users and returned an error. Fixed this by just handling this case.
  2. The GraphQL resolvers for savedSearches and prompts prevented anonymous users from listing items because there was no affiliated user and thus the anonymous user was essentially trying to list all. Fixed this by adding a new and well-tested code path for listing only public saved searches or prompts.

Test plan

In dotcom mode, visit those 2 pages (/saved-searches and /prompts).

@sqs sqs requested review from a team July 19, 2024 22:16
@cla-bot cla-bot Bot added the cla-signed label Jul 19, 2024
Anonymous visitors to Sourcegraph.com were unable to list all public saved searches (at https://sourcegraph.com/saved-searches) and prompts (at https://sourcegraph.com/prompts) for 2 reasons:

1. The namespace selector (filter) was broken for anonymous users and returned an error. Fixed this by just handling this case.
2. The GraphQL resolvers for `savedSearches` and `prompts` prevented anonymous users from listing items because there was no affiliated user and thus the anonymous user was essentially trying to list all. Fixed this by adding a new and well-tested code path for listing only public saved searches or prompts.

Test plan:

In dotcom mode, visit those 2 pages (`/saved-searches` and `/prompts`).
@sqs sqs force-pushed the sqs/affiliated-namespaces-anon-dotcom branch from 76bcf09 to c8a8b99 Compare July 19, 2024 22:26
@sqs sqs merged commit f633713 into main Jul 19, 2024
@sqs sqs deleted the sqs/affiliated-namespaces-anon-dotcom branch July 19, 2024 22:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants