Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
89d77c7
refactor: rename userName to proposedUsername in group metadata
Sotatek-DucPhung Oct 28, 2025
7487df9
feat: add groupUsername to IdentifierMetadataRecord and related services
Sotatek-DucPhung Oct 30, 2025
a41452e
refactor(EditProfile): streamline parameter handling for displayName …
Sotatek-DucPhung Oct 30, 2025
cc1e475
refactor(ui): simplify username handling and remove unused groupMetad…
Sotatek-DucPhung Oct 31, 2025
ced360e
chore: Merge remote-tracking branch 'origin/develop' into feature/VT2…
Sotatek-DucPhung Nov 3, 2025
8e30b6e
chore: fix type error after merge develop
Sotatek-DucPhung Nov 3, 2025
a07c5bd
test: add unit test for updating identifier groupUsername
Sotatek-DucPhung Nov 4, 2025
0ae64e7
refactor(ui): enhance username handling in various components and str…
Sotatek-DucPhung Nov 5, 2025
dee74b2
feat(ui): add setProfileMultisigConnections action and update group c…
Sotatek-DucPhung Nov 5, 2025
d6c5f33
test: enhance group creation handler tests
Sotatek-DucPhung Nov 5, 2025
9c7f9c7
chore: Merge remote-tracking branch 'origin/develop' into feature/VT2…
Sotatek-DucPhung Nov 5, 2025
e979588
feat(ui): update addGroupProfileAsync to fetch and dispatch multisig …
Sotatek-DucPhung Nov 6, 2025
40b0ad2
refactor(core): simplify groupId filtering logic
Sotatek-DucPhung Nov 6, 2025
cbef0a4
chore(ui): remove outdated comment
Sotatek-DucPhung Nov 6, 2025
703448b
refactor(core): streamline profilesCache logic and remove unused setP…
Sotatek-DucPhung Nov 6, 2025
1717223
refactor(core): update connection types to use MultisigConnectionDeta…
Sotatek-DucPhung Nov 6, 2025
4137cc9
test(ui): update ProfileSetup tests to utilize MultisigConnectionDetails
Sotatek-DucPhung Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/__fixtures__/agent/ipexCommunicationFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ const multisigParticipantsProps = {
groupId: "group-id",
groupInitiator: true,
groupCreated: true,
userName: "IdentifierName2",
proposedUsername: "IdentifierName2",
},
},
multisigMembers: {
Expand Down
4 changes: 2 additions & 2 deletions src/core/__fixtures__/agent/multiSigFixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const memberMetadataRecordProps: IdentifierMetadataRecordProps = {
groupId: "groupid",
groupInitiator: true,
groupCreated: false,
userName: "testUser",
proposedUsername: "testUser",
},
};

Expand Down Expand Up @@ -119,7 +119,7 @@ const memberIdentifierRecord = {
groupId: "08f22dee-8cb0-4d65-8600-a82bbc3f6fd7",
groupInitiator: true,
groupCreated: true,
userName: "testUser",
proposedUsername: "testUser",
},
updatedAt: new Date("2024-06-28T03:55:04.260Z"),
} as IdentifierMetadataRecordProps;
Expand Down
5 changes: 4 additions & 1 deletion src/core/agent/records/identifierMetadataRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface GroupMetadata {
groupId: string;
groupInitiator: boolean;
groupCreated: boolean;
userName: string;
proposedUsername: string;
}

interface IdentifierMetadataRecordProps {
Expand All @@ -17,6 +17,7 @@ interface IdentifierMetadataRecordProps {
theme: number;
groupMemberPre?: string;
groupMetadata?: GroupMetadata;
groupUsername?: string;
pendingDeletion?: boolean;
sxlt?: string;
tags?: Tags;
Expand All @@ -30,6 +31,7 @@ class IdentifierMetadataRecord extends BaseRecord {
pendingDeletion!: boolean;
groupMemberPre?: string;
groupMetadata?: GroupMetadata;
groupUsername?: string;
sxlt?: string;

static readonly type = "IdentifierMetadataRecord";
Expand All @@ -47,6 +49,7 @@ class IdentifierMetadataRecord extends BaseRecord {
this.isDeleted = props.isDeleted ?? false;
this.groupMetadata = props.groupMetadata;
this.groupMemberPre = props.groupMemberPre;
this.groupUsername = props.groupUsername;
this.pendingDeletion = props.pendingDeletion ?? false;
this.sxlt = props.sxlt;
this._tags = props.tags ?? {};
Expand Down
18 changes: 18 additions & 0 deletions src/core/agent/records/identifierStorage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ describe("Identifier storage test", () => {
expect(storageService.update).toBeCalled();
});

test("Should update identifier groupUsername", async () => {
const identifierWithGroupUsername = new IdentifierMetadataRecord({
...identifierMetadataRecordProps,
groupUsername: "oldUsername",
});
storageService.findById.mockResolvedValue(identifierWithGroupUsername);

await identifierStorage.updateIdentifierMetadata(
identifierMetadataRecord.id,
{
groupUsername: "newUsername",
}
);

expect(identifierWithGroupUsername.groupUsername).toBe("newUsername");
expect(storageService.update).toBeCalledWith(identifierWithGroupUsername);
});

test("Should get all identifier pending deletion", async () => {
storageService.findAllByQuery.mockResolvedValue([
{
Expand Down
3 changes: 3 additions & 0 deletions src/core/agent/records/identifierStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class IdentifierStorage {
| "creationStatus"
| "isDeleted"
| "groupMetadata"
| "groupUsername"
| "pendingDeletion"
>
>
Expand All @@ -85,6 +86,8 @@ class IdentifierStorage {
identifierMetadataRecord.isDeleted = metadata.isDeleted;
if (metadata.groupMetadata !== undefined)
identifierMetadataRecord.groupMetadata = metadata.groupMetadata;
if (metadata.groupUsername !== undefined)
identifierMetadataRecord.groupUsername = metadata.groupUsername;
if (metadata.pendingDeletion !== undefined)
identifierMetadataRecord.pendingDeletion = metadata.pendingDeletion;
await this.storageService.update(identifierMetadataRecord);
Expand Down
3 changes: 2 additions & 1 deletion src/core/agent/services/identifier.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface GroupMetadata {
groupId: string;
groupInitiator: boolean;
groupCreated: boolean;
userName: string;
proposedUsername: string;
initiatorName?: string;
}

Expand All @@ -28,6 +28,7 @@ interface IdentifierShortDetails {
creationStatus: CreationStatus;
groupMetadata?: GroupMetadata;
groupMemberPre?: string;
groupUsername?: string;
}

interface IdentifierDetails extends IdentifierShortDetails {
Expand Down
Loading