Skip to content

Commit 44ac18a

Browse files
committed
Indicating when the body wasn't stored for the audited message
1 parent f521388 commit 44ac18a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Frontend/src/components/messages/BodyView.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ const body = computed(() => bodyState.value.data.value);
2525
<div v-if="bodyState.not_found" class="alert alert-info">Could not find the message body. This could be because the message URL is invalid or the corresponding message was processed and is no longer tracked by ServiceControl.</div>
2626
<div v-else-if="bodyState.failed_to_load" class="alert alert-info">Message body unavailable.</div>
2727
<LoadingSpinner v-else-if="bodyState.loading" />
28+
<div v-else-if="bodyState.data.no_content" class="alert alert-info">
29+
Body was too large and not stored. Edit <a href="https://docs.particular.net/servicecontrol/audit-instances/configuration#performance-tuning-servicecontrol-auditmaxbodysizetostore">ServiceControl/MaxBodySizeToStore</a> to be larger in the
30+
ServiceControl configuration.
31+
</div>
2832
<CodeEditor v-else-if="body !== undefined && contentType.isSupported" :model-value="body" :language="contentType.language" :read-only="true" :show-gutter="true"></CodeEditor>
2933
<div v-else-if="body && !contentType.isSupported" class="alert alert-warning">Message body cannot be displayed because content type "{{ bodyState.data.content_type }}" is not supported.</div>
3034
</div>

src/Frontend/src/stores/MessageStore.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ interface Model {
6161

6262
export const useMessageStore = defineStore("MessageStore", () => {
6363
const headers = ref<DataContainer<Header[]>>({ data: [] });
64-
const body = ref<DataContainer<{ value?: string; content_type?: string }>>({ data: {} });
64+
const body = ref<DataContainer<{ value?: string; content_type?: string; no_content?: boolean }>>({ data: {} });
6565
const state = reactive<DataContainer<Model>>({ data: { failure_metadata: {}, failure_status: {}, dialog_status: {}, invoked_saga: {} } });
6666
let bodyLoadedId = "";
6767
let conversationLoadedId = "";
@@ -204,6 +204,12 @@ export const useMessageStore = defineStore("MessageStore", () => {
204204
return;
205205
}
206206

207+
if (response.status === 204) {
208+
body.value.data.no_content = true;
209+
210+
return;
211+
}
212+
207213
const contentType = response.headers.get("content-type");
208214
body.value.data.content_type = contentType ?? "text/plain";
209215
body.value.data.value = await response.text();
@@ -288,7 +294,7 @@ export const useMessageStore = defineStore("MessageStore", () => {
288294

289295
await downloadBody();
290296

291-
if (!(body.value.not_found || body.value.failed_to_load)) {
297+
if (!(body.value.not_found || body.value.failed_to_load || body.value.data.no_content)) {
292298
exportString += "\n\nMESSAGE BODY\n";
293299
exportString += body.value.data.value;
294300
}

0 commit comments

Comments
 (0)