Skip to content

Commit

Permalink
Merge pull request #4277 from systeminit/jobelenus/take-out-the-trash
Browse files Browse the repository at this point in the history
Removing "within-a-changeset" conflict detection & retry we don't need
  • Loading branch information
jobelenus authored Aug 6, 2024
2 parents d80ad04 + 4010e9d commit 36d7f0b
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 283 deletions.
1 change: 0 additions & 1 deletion app/web/src/components/ModelingDiagram/ModelingDiagram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ overflow hidden */
</v-stage>

<DiagramHelpModal ref="helpModalRef" />
RECTS: {{ selectionRects }}
</div>
</div>
</template>
Expand Down
4 changes: 0 additions & 4 deletions app/web/src/components/StatusBar/StatusBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<div class="flex text-sm items-center pl-xs mr-lg w-full">
System&nbsp;Initiative
</div>
<div class="border-l border-shade-100">
<StatusBarConflictSummary />
</div>
<div class="border-l border-shade-100">
<StatusBarDiffSummary v-if="!changeSetStore.headSelected" />
</div>
Expand All @@ -31,7 +28,6 @@ import * as _ from "lodash-es";
import clsx from "clsx";
import { useChangeSetsStore } from "@/store/change_sets.store";
import StatusBarConflictSummary from "./StatusBarConflictSummary.vue";
import StatusBarDiffSummary from "./StatusBarDiffSummary.vue";
import StatusBarResourceSummary from "./StatusBarResourceSummary.vue";
import StatusBarQualificationSummary from "./StatusBarQualificationSummary.vue";
Expand Down
180 changes: 0 additions & 180 deletions app/web/src/components/StatusBar/StatusBarConflictSummary.vue

This file was deleted.

58 changes: 0 additions & 58 deletions app/web/src/components/toasts/Conflict.vue

This file was deleted.

12 changes: 0 additions & 12 deletions app/web/src/store/status.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { ComponentId, SocketId } from "@/api/sdf/dal/component";
import { useChangeSetsStore } from "./change_sets.store";
import { useRealtimeStore } from "./realtime/realtime.store";
import UpdatingModel from "../components/toasts/UpdatingModel.vue";
import ConflictToast from "../components/toasts/Conflict.vue";

import { useComponentsStore } from "./components.store";
import handleStoreError from "./errors";
Expand Down Expand Up @@ -271,17 +270,6 @@ export const useStatusStore = (forceChangeSetId?: ChangeSetId) => {
return `Updating ${latestUpdate.componentLabel}`;
},
},
actions: {
addConflictFromHttp(conflict: Conflict): void {
this.rawConflicts.push(conflict);
toast({
component: ConflictToast,
props: {
conflict,
},
});
},
},
onActivated() {
if (!changeSetId) return;

Expand Down
28 changes: 0 additions & 28 deletions lib/vue-lib/src/pinia/pinia_api_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ declare module "pinia" {
// augments the store's state
export interface PiniaCustomStateProperties<S> {
apiRequestStatuses: RawRequestStatusesByKey;
availableRetries: ConflictsForRetry;
}
}

Expand Down Expand Up @@ -230,15 +229,10 @@ export const initPiniaApiToolkitPlugin = (config: { api: AxiosInstance }) => {
store.apiRequestStatuses = reactive({} as RawRequestStatusesByKey);
(store.$state as any).apiRequestStatuses = store.apiRequestStatuses;

// 409 conflicts get stored in here
store.availableRetries = reactive({} as ConflictsForRetry);
(store.$state as any).availableRetries = store.availableRetries;

// make available to devtools
if (import.meta.env.DEV) {
// eslint-disable-next-line no-underscore-dangle
store._customProperties.add("apiRequestStatuses");
store._customProperties.add("availableRetries");
}

// triggers a named api request passing in a payload
Expand Down Expand Up @@ -433,14 +427,6 @@ export const initPiniaApiToolkitPlugin = (config: { api: AxiosInstance }) => {
span.end();
});
request.setFailedResult(triggerResult.error);
if (
actionName !== "SET_COMPONENT_GEOMETRY" &&
triggerResult.error.response?.status === 409
) {
store.$patch((state) => {
state.availableRetries[requestUlid] = [actionName, actionResult];
});
}
} else {
request.setSuccessfulResult(triggerResult.data);
}
Expand Down Expand Up @@ -552,24 +538,10 @@ export const initPiniaApiToolkitPlugin = (config: { api: AxiosInstance }) => {
delete store.$state.apiRequestStatuses[fullKey];
};

const RETRY_CONFLICT = async (requestUlid: RequestUlid) => {
const r = store.$state.availableRetries[requestUlid];
if (!r) throw Error(`No retry found for: ${requestUlid}`);
const actionName = r[0];
const apiRequest = r[1];
store.$patch((state) => {
delete state.availableRetries[requestUlid];
});
const newRequestUlid = ulid();
await fireActionResult(actionName, apiRequest, newRequestUlid);
return apiRequest;
};

return {
getRequestStatus,
getRequestStatuses,
clearRequestStatus,
RETRY_CONFLICT,
...apiRequestActions,
};
};
Expand Down

0 comments on commit 36d7f0b

Please sign in to comment.