Skip to content
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

Show reputation of contacts #1365

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

azackmatoff
Copy link
Collaborator

@azackmatoff azackmatoff commented Jul 11, 2023

Closes #1178

This is how it looks now:

No contacts available Contacts with reputations
Simulator Screen Shot - iPhone 14 Plus - 2023-07-11 at 18 06 13 Simulator Screen Shot - iPhone 14 Plus - 2023-07-11 at 18 11 23

Contacts with reputations get names from here:

enum Reputation { Unverified, UnverifiedReputable, VerifiedUnlinked, VerifiedLinked }

which comes from webApi.encointer.getReputations(String address).

We also have
enum ParticipantType { Bootstrapper, Reputable, Endorsee, Newbie }

which comes from

webApi.encointer.getAggregatedAccountData(CommunityIdentifier cid, String pubKey)

When the end result compared, Reputation with ParticipantType, they have conflicting information.

When reputation is

reputation = 
{
   1: {
    "communityIdentifier":
     {"geohash":"0x73716d3176","digest":"0xf08c911c"},
     "reputation":"VerifiedUnlinked"
     }
}

participantType can be null, as in example shown below, participantType comes from personal

{
 "global":
 {
   "ceremonyPhase":"Registering",
   "ceremonyIndex":2
 },
"personal":null
}

@clangenb HELP NEEDED HERE! Which one do I go with?

NOTE: Did local integration tests on android on two different devices, both passed. Cannot understand why not passing here in actions.

@azackmatoff azackmatoff added A2-technical PR introduces technical changes B1-medium Elevates a release containing this PR to "medium priority" C0-breaksnothing PR does not introduce any breaking changes labels Jul 11, 2023
@azackmatoff azackmatoff self-assigned this Jul 11, 2023
@clangenb
Copy link
Member

clangenb commented Jul 11, 2023

Nice, this looks already good! We want to go with the version from webApi.encointer.getAggregatedAccountData(CommunityIdentifier cid, String pubKey), which tells as the overall reputation of an account.

The other is only relevant for the current registration, and it does not really say anything about the total reputation.

@azackmatoff
Copy link
Collaborator Author

Nice, this looks already good! We want to go with the version from webApi.encointer.getAggregatedAccountData(CommunityIdentifier cid, String pubKey), which tells as the overall reputation of an account.

The other is only relevant for the current registration, and it does not really say anything about the total reputation.

Thanks Chris, this is exactly what I needed

Copy link
Member

@clangenb clangenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far! Some minor issues, and the tests seem to be failing thought. :)

app/pubspec_overrides.yaml Outdated Show resolved Hide resolved
app/lib/store/account/types/account_data.dart Show resolved Hide resolved
app/lib/l10n/arb/app_en.arb Outdated Show resolved Hide resolved
app/lib/store/settings.dart Outdated Show resolved Hide resolved
Copy link
Member

@clangenb clangenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some small thing on the contacts page, which I would like to have resolved. Apart from that it looks good! I can't tell why all integration tests fail though just by looking at the code.

app/lib/l10n/arb/app_de.arb Outdated Show resolved Hide resolved
Comment on lines +64 to +65
if (_contactsPageStore.isLoading) {
return const Center(child: CircularProgressIndicator());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the whole contact page should be loading, but only the part holding the reputation.

@@ -283,7 +286,7 @@ class EndorseButton extends StatelessWidget {
} else if (store.encointer.currentPhase != CeremonyPhase.Registering) {
await _popupDialog(context, l10n.canEndorseInRegisteringPhaseOnly);
} else {
await submitEndorseNewcomer(context, store, api, store.encointer.chosenCid, address);
await submitEndorseNewcomer(context, store, webApi, store.encointer.chosenCid, address);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer it the other way. Better to pass an argument and minimize the references to globals. Or what was your thinking here?

app/lib/store/settings.dart Outdated Show resolved Hide resolved
app/lib/l10n/arb/app_fr.arb Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A2-technical PR introduces technical changes B1-medium Elevates a release containing this PR to "medium priority" C0-breaksnothing PR does not introduce any breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show reputation of contacts
2 participants