Description
GET /umbraco/management/api/v1/UrlTracker/RecommendationAnalysis/{id}/referrers (the backoffice "Recommendation Analysis" screen) throws an unhandled ArgumentOutOfRangeException instead of returning the most-common-referrer data.
Steps to Reproduce
- Trigger a 404 on a URL that UrlTracker tracks as a client error (e.g. visit a non-existent page), so a
ClientError row is created for that URL.
- Cause at least one referrer to be recorded against that client error (e.g. hit the 404 URL again with a
Referer header set, or via a link from another tracked page), so a ClientError2Referrer row exists.
- In the Umbraco backoffice, open UrlTracker → Recommendations, select that recommendation, and open its Recommendation Analysis screen.
- Equivalently, call
GET /umbraco/management/api/v1/UrlTracker/RecommendationAnalysis/{id}/referrers directly, where {id} is the recommendation's id.
Expected Behavior
The endpoint returns 200 OK with the list of most-common referrers for that client error (or an empty list if there are none / the error is ignored).
Actual Behavior
The request fails with an unhandled ArgumentOutOfRangeException, and the Recommendation Analysis screen fails to load referrer data.
umbraco/management/api/v1/UrlTracker/RecommendationAnalysis/13/referrers
/umbraco/management/api/v1/UrlTracker/RecommendationAnalysis/13/history
Suggested fix
Replace: ClientErrorRepository.cs:217
sql.Where<ClientError2ReferrerDto>(e => clientErrors.Contains(e.ClientError), _occurrancesTableAlias)
with:
sql.WhereIn<ClientError2ReferrerDto>(e => e.ClientError, clientErrors, _occurrancesTableAlias)
Description
GET /umbraco/management/api/v1/UrlTracker/RecommendationAnalysis/{id}/referrers(the backoffice "Recommendation Analysis" screen) throws an unhandledArgumentOutOfRangeExceptioninstead of returning the most-common-referrer data.Steps to Reproduce
ClientErrorrow is created for that URL.Refererheader set, or via a link from another tracked page), so aClientError2Referrerrow exists.GET /umbraco/management/api/v1/UrlTracker/RecommendationAnalysis/{id}/referrersdirectly, where{id}is the recommendation's id.Expected Behavior
The endpoint returns
200 OKwith the list of most-common referrers for that client error (or an empty list if there are none / the error is ignored).Actual Behavior
The request fails with an unhandled
ArgumentOutOfRangeException, and the Recommendation Analysis screen fails to load referrer data.umbraco/management/api/v1/UrlTracker/RecommendationAnalysis/13/referrers/umbraco/management/api/v1/UrlTracker/RecommendationAnalysis/13/historySuggested fix
Replace: ClientErrorRepository.cs:217
sql.Where<ClientError2ReferrerDto>(e => clientErrors.Contains(e.ClientError), _occurrancesTableAlias)with:
sql.WhereIn<ClientError2ReferrerDto>(e => e.ClientError, clientErrors, _occurrancesTableAlias)