File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
static/app/views/insights/pages/conversations/hooks Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -228,16 +228,23 @@ describe('useConversation', () => {
228228 expect ( result . current . isLoading ) . toBe ( false ) ;
229229 } ) ;
230230
231- // Verify the API was called with correct timestamps (with 1-hour padding)
231+ // Verify the API was called with correct timestamps (with 1-hour padding),
232+ // ALL_ACCESS_PROJECTS (-1) so it searches across all projects,
233+ // and no environment filter so it searches across all environments
232234 expect ( mockRequest ) . toHaveBeenCalledWith (
233235 expect . stringContaining ( '/ai-conversations/conv-timestamps/' ) ,
234236 expect . objectContaining ( {
235237 query : expect . objectContaining ( {
236238 start : new Date ( startTimestamp - 60 * 60 * 1000 ) . toISOString ( ) ,
237239 end : new Date ( endTimestamp + 60 * 60 * 1000 ) . toISOString ( ) ,
240+ project : [ - 1 ] ,
238241 } ) ,
239242 } )
240243 ) ;
244+
245+ // Ensure environment is not included in the query when using conversation timestamps
246+ const queryArg = mockRequest . mock . calls [ 0 ] ! [ 1 ] ! . query ;
247+ expect ( queryArg ) . not . toHaveProperty ( 'environment' ) ;
241248 } ) ;
242249
243250 it ( 'falls back to span.name when span.description is empty' , async ( ) => {
Original file line number Diff line number Diff line change 11import { useEffect , useMemo } from 'react' ;
22
3+ import { ALL_ACCESS_PROJECTS } from 'sentry/components/pageFilters/constants' ;
34import { normalizeDateTimeParams } from 'sentry/components/pageFilters/parse' ;
45import { usePageFilters } from 'sentry/components/pageFilters/usePageFilters' ;
56import { getApiUrl } from 'sentry/utils/api/getApiUrl' ;
@@ -193,10 +194,12 @@ export function useConversation(
193194 const hasConversationTimestamps =
194195 conversation . startTimestamp !== undefined && conversation . endTimestamp !== undefined ;
195196
197+ // When conversation timestamps are provided (e.g. from a shared link),
198+ // search across all projects and environments so the conversation is found
199+ // regardless of which project/environment the page filter is currently set to.
196200 const queryParams = hasConversationTimestamps
197201 ? {
198- project : selection . projects ,
199- environment : selection . environments ,
202+ project : [ ALL_ACCESS_PROJECTS ] ,
200203 start : new Date ( conversation . startTimestamp ! - ONE_HOUR_MS ) . toISOString ( ) ,
201204 end : new Date ( conversation . endTimestamp ! + ONE_HOUR_MS ) . toISOString ( ) ,
202205 per_page : 1000 ,
You can’t perform that action at this time.
0 commit comments