Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: downgrade for legacy commit data (#4664)

Liu Jif489991a344e
diff --git a/frontend/src/components/ActivityTable/ActivityTypeLink.vue b/frontend/src/components/ActivityTable/ActivityTypeLink.vue
index aa602ad362..de9f2ebe56 100644
--- a/frontend/src/components/ActivityTable/ActivityTypeLink.vue
+++ b/frontend/src/components/ActivityTable/ActivityTypeLink.vue
@@ -17,6 +17,8 @@
<script lang="ts">
import { computed, defineComponent, PropType } from "vue";
+import { head } from "lodash-es";
+
import {
Activity,
ActivityProjectRepositoryPushPayload,
@@ -39,11 +41,17 @@ export default defineComponent({
case "bb.project.repository.push": {
const payload =
activity.payload as ActivityProjectRepositoryPushPayload;
- return {
- title: payload.pushEvent.fileCommit.id.substring(0, 7),
- path: payload.pushEvent.fileCommit.url,
- external: true,
- };
+ const commit =
+ head(payload.pushEvent.commits) ?? payload.pushEvent.fileCommit;
+ if (commit && commit.id && commit.url) {
+ return {
+ title: commit.id.substring(0, 7),
+ path: commit.url,
+ external: true,
+ };
+ }
+ // Downgrade for legacy data.
+ return undefined;
}
case "bb.project.database.transfer": {
const payload =