Draft: Fix error_tracking details link generation logic
What does this MR do and why?
Improve error_tracking details link generation logic. It fixes a bug reported at #430211 (closed) , where having a trailing /
in the URL would cause the details link not to work correctly (404 returned)
Screenshots or screen recordings
NA
How to set up and validate locally
Apply patch to apply mocks pbpaste | git apply --allow-empty
pbpaste | git apply --allow-empty
diff --git a/app/assets/javascripts/error_tracking/store/list/actions.js b/app/assets/javascripts/error_tracking/store/list/actions.js
index 84e4463ca216..c73344ce2bac 100644
--- a/app/assets/javascripts/error_tracking/store/list/actions.js
+++ b/app/assets/javascripts/error_tracking/store/list/actions.js
@@ -9,37 +9,65 @@ let eTagPoll;
export function startPolling({ state, commit, dispatch }) {
commit(types.SET_LOADING, true);
- eTagPoll = new Poll({
- resource: Service,
- method: 'getSentryData',
- data: {
- endpoint: state.endpoint,
- params: {
- search_term: state.searchQuery,
- sort: state.sortField,
- cursor: state.cursor,
- issue_status: state.statusFilter,
+ const data = {
+ errors: [
+ {
+ id: '2650783669',
+ title: __('Error'),
+ type: null,
+ user_count: 1,
+ count: 2,
+ first_seen: '2023-04-20T17:00:48.261Z',
+ last_seen: '2023-04-20T17:00:50.941Z',
+ message: 'Hello from ReactSDK',
+ culprit: './src/index.js()',
+ external_url: null,
+ project_id: null,
+ project_name: null,
+ project_slug: null,
+ short_id: null,
+ status: 'unresolved',
+ frequency: null,
},
- },
- successCallback: ({ data }) => {
- if (!data) {
- return;
- }
-
- commit(types.SET_PAGINATION, data.pagination);
- commit(types.SET_ERRORS, data.errors);
- commit(types.SET_LOADING, false);
- dispatch('stopPolling');
- },
- errorCallback: () => {
- commit(types.SET_LOADING, false);
- createAlert({
- message: __('Failed to load errors from Sentry.'),
- });
- },
- });
-
- eTagPoll.makeRequest();
+ ],
+ pagination: {},
+ external_url: null,
+ };
+
+ commit(types.SET_ERRORS, data.errors);
+ commit(types.SET_LOADING, false);
+
+ // eTagPoll = new Poll({
+ // resource: Service,
+ // method: 'getSentryData',
+ // data: {
+ // endpoint: state.endpoint,
+ // params: {
+ // search_term: state.searchQuery,
+ // sort: state.sortField,
+ // cursor: state.cursor,
+ // issue_status: state.statusFilter,
+ // },
+ // },
+ // successCallback: ({ data }) => {
+ // if (!data) {
+ // return;
+ // }
+
+ // commit(types.SET_PAGINATION, data.pagination);
+ // commit(types.SET_ERRORS, data.errors);
+ // commit(types.SET_LOADING, false);
+ // dispatch('stopPolling');
+ // },
+ // errorCallback: () => {
+ // commit(types.SET_LOADING, false);
+ // createAlert({
+ // message: __('Failed to load errors from Sentry.'),
+ // });
+ // },
+ // });
+
+ // eTagPoll.makeRequest();
}
export const stopPolling = () => {
- Go to https://local.gitlab.com:3443/flightjs/Flight/-/error_tracking/ ( try with and without trailing
/
) - Click on an error and check that it takes you correctly to the details page ( should get an error dialog , but not a 404 as reported in #430211 (closed) )
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Daniele Rossetti