Skip to content

Commit af99610

Browse files
committed
fix(core): ipex agree filtering for connection history
1 parent b352e24 commit af99610

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/core/agent/services/connectionService.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Agent } from "../agent";
1212
import { OperationPendingRecordType } from "../records/operationPendingRecord.type";
1313
import { EventTypes } from "../event.types";
1414
import {
15+
ConnectionHistoryItem,
1516
ConnectionHistoryType,
1617
KeriaContactKeyPrefix,
1718
} from "./connectionService.types";
@@ -1139,20 +1140,18 @@ describe("Connection service of agent", () => {
11391140
message: "message",
11401141
};
11411142

1142-
const mockHistoryItems = [
1143+
const mockHistoryItems: ConnectionHistoryItem[] = [
11431144
{
11441145
id: "ipex1",
11451146
credentialType: "lei",
11461147
historyType: ConnectionHistoryType.IPEX_AGREE_COMPLETE,
1147-
type: ConnectionHistoryType.IPEX_AGREE_COMPLETE,
11481148
dt: "2025-02-25T10:00:00.000Z",
11491149
connectionId: "connectionId",
11501150
},
11511151
{
11521152
id: "cred1",
11531153
credentialType: "lei",
11541154
historyType: ConnectionHistoryType.CREDENTIAL_ISSUANCE,
1155-
type: ConnectionHistoryType.CREDENTIAL_ISSUANCE,
11561155
dt: "2025-02-25T09:00:00.000Z",
11571156
connectionId: "connectionId",
11581157
},

src/core/agent/services/connectionService.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,10 @@ class ConnectionService extends AgentService {
312312
key.startsWith(KeriaContactKeyPrefix.HISTORY_IPEX) ||
313313
key.startsWith(KeriaContactKeyPrefix.HISTORY_REVOKE)
314314
) {
315-
const historyItem = JSON.parse(connection[key] as string);
316-
if (full || !skippedHistoryTypes.includes(historyItem.type)) {
315+
const historyItem: ConnectionHistoryItem = JSON.parse(
316+
connection[key] as string
317+
);
318+
if (full || !skippedHistoryTypes.includes(historyItem.historyType)) {
317319
historyItems.push(historyItem);
318320
}
319321
}

0 commit comments

Comments
 (0)