Skip to content

Commit

Permalink
Merge branch 'feat/multiSigEnhanced' into feat/DTIS-808-Enable-Sharin…
Browse files Browse the repository at this point in the history
…g-OOBI-When-Direct-Scanning-is-Not-Possible
  • Loading branch information
sdisalvo-crd committed May 8, 2024
2 parents f3f3d13 + dece778 commit f58cf8b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/agent/records/identifierMetadataRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class IdentifierMetadataRecord
isArchived: this.isArchived,
isDeleted: this.isDeleted,
isPending: this.isPending,
groupCreated: this.groupMetadata?.groupCreated,
};
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/core/agent/services/identifierService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,9 @@ class IdentifierService extends AgentService {
RecordType.IDENTIFIER_METADATA_RECORD,
{
isArchived,
$not: {
groupCreated: true,
},
}
);
return basicRecords.map((bc) => {
Expand Down
24 changes: 22 additions & 2 deletions src/ui/components/AppWrapper/AppWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { NotificationRoute } from "../../../core/agent/modules/signify/signifyAp
import "./AppWrapper.scss";
import { ConfigurationService } from "../../../core/configuration";
import { PreferencesStorageItem } from "../../../core/storage/preferences/preferencesStorage.type";
import { IdentifierService } from "../../../core/agent/services";

const connectionKeriStateChangedHandler = async (
event: ConnectionKeriStateChangedEvent,
Expand Down Expand Up @@ -76,6 +77,18 @@ const keriNotificationsChangeHandler = async (
})
);
} else if (event?.a?.r === NotificationRoute.MultiSigIcp) {
processMultiSigIcpNotification(event, dispatch);
} else if (event?.a?.r === NotificationRoute.MultiSigRot) {
//TODO: Use dispatch here, handle logic for the multisig rotation notification
}
};

const processMultiSigIcpNotification = async (
event: KeriNotification,
dispatch: ReturnType<typeof useAppDispatch>,
retryInterval = 3000
) => {
try {
const multisigIcpDetails =
await Agent.agent.identifiers.getMultisigIcpDetails(event);
dispatch(
Expand All @@ -86,8 +99,15 @@ const keriNotificationsChangeHandler = async (
multisigIcpDetails: multisigIcpDetails,
})
);
} else if (event?.a?.r === NotificationRoute.MultiSigRot) {
//TODO: Use dispatch here, handle logic for the multisig rotation notification
} catch (error) {
if (
(error as Error).message == IdentifierService.UNKNOWN_AIDS_IN_MULTISIG_ICP
) {
await new Promise((resolve) => setTimeout(resolve, retryInterval));
await processMultiSigIcpNotification(event, dispatch, retryInterval);
} else {
throw error;
}
}
};

Expand Down

0 comments on commit f58cf8b

Please sign in to comment.