Skip to content

Commit

Permalink
feat: post merge changes (forgot to stage)
Browse files Browse the repository at this point in the history
  • Loading branch information
iFergal committed May 7, 2024
1 parent e1a6d59 commit fee1d10
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 86 deletions.
4 changes: 4 additions & 0 deletions src/core/agent/records/connectionRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ interface ConnectionRecordStorageProps {
tags?: Tags;
alias: string;
oobi: string;
groupId?: string;
}

class ConnectionRecord extends BaseRecord {
alias!: string;
oobi!: string;
groupId?: string;
static readonly type = "ConnectionRecord";
readonly type = ConnectionRecord.type;

Expand All @@ -22,13 +24,15 @@ class ConnectionRecord extends BaseRecord {
this.createdAt = props.createdAt ?? new Date();
this.alias = props.alias;
this.oobi = props.oobi;
this.groupId = props.groupId;
this._tags = props.tags ?? {};
}
}

getTags() {
return {
...this._tags,
groupId: this.groupId,
};
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/core/agent/records/identifierStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ class IdentifierStorage {
const record = new IdentifierMetadataRecord(data);
await this.storageService.save(record);
}

async getIdentifierMetadataByGroupId(
groupId: string
): Promise<IdentifierMetadataRecord | null> {
const records = await this.storageService.findAllByQuery(
{
groupId,
},
IdentifierMetadataRecord
);
if (records.length > 0) {
return records[0];
}
return null;
}
}

export { IdentifierStorage };
1 change: 0 additions & 1 deletion src/core/agent/services/connectionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ class ConnectionService extends AgentService {
const connectionsDetails: ConnectionShortDetails[] = [];
const metadatas = await this.getAllConnectionMetadata();
metadatas.forEach(async (connection) => {
connectionsDetails.push(this.getConnectionShortDetails(connection));
// @TODO - foconnor: This filter should be via the SQL, may cause a regression so this is a temp solution.
if (connection.getTag("groupId") === undefined) {
connectionsDetails.push(this.getConnectionShortDetails(connection));
Expand Down

0 comments on commit fee1d10

Please sign in to comment.