@@ -27,6 +27,7 @@ import { uniqWith } from 'lodash';
2727 */
2828import { Fragment } from '@wordpress/element' ;
2929import { __ , sprintf } from '@wordpress/i18n' ;
30+ import { removeQueryArgs } from '@wordpress/url' ;
3031
3132/**
3233 * Internal dependencies
@@ -39,7 +40,6 @@ import {
3940} from '@/js/util/errors' ;
4041import { getInsufficientPermissionsErrorDescription } from '@/js/util/insufficient-permissions-error-description' ;
4142import { purify } from '@/js/util/purify' ;
42- import { removeParamFromURL } from '@/js/util/urls' ;
4343import CTA from './notifications/CTA' ;
4444import ReportErrorActions from './ReportErrorActions' ;
4545import useViewOnly from '@/js/hooks/useViewOnly' ;
@@ -93,12 +93,15 @@ export default function ReportError( { moduleSlug, error } ) {
9393 errors . map ( ( err ) => ( {
9494 ...err ,
9595 message : getMessage ( err ) ,
96- reconnectURL : err . data ?. reconnectURL ,
96+ // The `code` parameter contains a session ID which can vary
97+ // between requests, so we ignore it when comparing.
98+ reconnectURL : err . data ?. reconnectURL
99+ ? removeQueryArgs ( err . data ?. reconnectURL , 'code' )
100+ : undefined ,
97101 } ) ) ,
98102 ( errorA , errorB ) =>
99103 errorA . message === errorB . message &&
100- removeParamFromURL ( errorA . reconnectURL , 'code' ) ===
101- removeParamFromURL ( errorB . reconnectURL , 'code' )
104+ errorA . reconnectURL === errorB . reconnectURL
102105 ) ;
103106
104107 const hasInsufficientPermissionsError = errors . some ( ( err ) =>
0 commit comments