-
Notifications
You must be signed in to change notification settings - Fork 26
feat(core): Cleaner way to provide group name to UI #1408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat(core): Cleaner way to provide group name to UI #1408
Conversation
e8f0d6e to
89d77c7
Compare
|
@iFergal Please ignore the previous review comments, as I’ve force-pushed a reimplementation. |
src/ui/pages/NotificationDetails/components/MultiSigRequest/ErrorPage.tsx
Show resolved
Hide resolved
…and groupMetadata updates
…0-2166-cleaner-way-to-provide-group-name
…eamline identifier retrieval
…reation handler to refresh multisig connections
| dispatch(addGroupProfileAsync(event.payload.group)); | ||
| await dispatch(addGroupProfileAsync(event.payload.group)); | ||
|
|
||
| // Refresh multisig connections cache after group is created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addGroupProfile already sets multisigConnections: group.multisigConnections - we shouldn't need these changes. Can you check why it's not working there?
| if (profile.groupMemberPre && identifiers[profile.groupMemberPre]) { | ||
| groupIdToFilter = | ||
| identifiers[profile.groupMemberPre].groupMetadata?.groupId; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const groupIdToFilter = profile.groupMemberPre ? identifiers[profile.groupMemberPre]?.groupMetadata?.groupId : profile.groupMetadata?.groupId; would work to simplify.
| ); | ||
| const storedIdentifiers = await Agent.agent.identifiers.getIdentifiers(); | ||
| const allIdentifiersIncludingMember = | ||
| await Agent.agent.identifiers.getIdentifiers(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a general refactor we should dod here for filtering. But I would do it in another PR. Leaving this comment as a reminder for me.
|
|
||
| const isMember = !identity?.groupMetadata?.groupInitiator; | ||
| const isPendingMember = isMember && initGroupNotification; | ||
| const isPendingMember = !!initGroupNotification; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this variable is meant to be doing but we cannot rely on the notification alone because after the notification is deleted, the group may still be pending. @Sotatek-DukeVu please comment
|
|
||
| const getInceptionStatus = useCallback(async () => { | ||
| if (!identity?.id || !identity?.groupMetadata) return; | ||
| // We can fetch inception status using gHab id even if groupMetadata is not stored on gHab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This explains the change but isn't needed to be kept in the code since new devs will never know we had it there. lets remove this one!
| ? cardData.groupUsername || | ||
| cardData.groupMetadata?.proposedUsername || | ||
| "" | ||
| : member); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably isCurrent means if this member equals us, right?
Cleaner way to provide group name to UI
Description
Renamed group metadata username to proposedUsername, introduced groupUsername/groupId, and stopped persisting groupMetadata on group identifiers; all agent services, migrations, utilities, fixtures, tests, and event payloads now reflect the new schema.
Updated UI selectors, components, and profile state handling to read groupUsername or member metadata, adjusted pending-group modals, and refreshed fixtures/tests accordingly.
Checklist before requesting a review
Issue ticket number and link
Testing & Validation
Design Review