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

Contact attributes disappears after re-resolving OOBI and querying key state #291

Open
lenkan opened this issue Sep 6, 2024 · 1 comment · May be fixed by WebOfTrust/keripy#882
Open

Comments

@lenkan
Copy link
Collaborator

lenkan commented Sep 6, 2024

  • version: 0.1.3, 0.2.0-devX and latest main

Steps to reproduce

  1. Resolve oobi for AID X with an alias
  2. Update contact for AID X with an attribute, e.g group: "foobar"
  3. List the contacts, verify group: "foobar" is there
  4. Resolve oobi for AID X with the same alias as step 1
  5. List the contacts, verify group: "foobar" is there
  6. Query the key state of AID x
  7. List the contacts

Expected result

group:"foobar" is still on the contact

Actual result

group:"foobar" is no longer on the contact

Automatic reproduction

See reproduction https://github.com/nordlei/vlei-sandbox/blob/main/src/issues/contact-attributes-disappears-after-query.test.ts

git clone git@github.com:nordlei/vlei-sandbox.git
cd vlei-sandbox
docker compose run --rm --build test npm start src/issues/contact-attributes-disappears-after-query.test.ts

It seems like the contact attributes are removed from the contact.

Output:

 RUN  v2.0.5 /app

 ❯ src/oobi.test.ts (4) 6962ms
   ✓ Resolve OOBIs
   ✓ Update contact details
   ✓ Refresh oobi
   × Query key state 889ms

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/oobi.test.ts > Query key state
AssertionError: expected { alias: 'alias2', …(2) } to match object { …(3) }
(1 matching property omitted from actual)

- Expected
+ Received

  Object {
    "alias": "alias2",
-   "group": "abc",
    "id": "EO5VdAGz365Cf33Oz1HQ8JOLCjg8Df4uQWH901rJkc_u",
  }

 ❯ src/oobi.test.ts:50:74
     48|   await wallet1.queryKeyState(wallet2.identifier.prefix);
     49|
     50|   expect(await wallet1.client.contacts().get(wallet2.identifier.prefix)).toMatchObjec…
       |                                                                          ^
     51|     id: wallet2.identifier.prefix,
     52|     alias: wallet2.identifier.name,

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

 Test Files  1 failed (1)
      Tests  1 failed | 3 passed (4)
   Start at  12:59:14
   Duration  8.13s (transform 53ms, setup 0ms, collect 926ms, tests 6.96s, environment 0ms, prepare 87ms)
@rodolfomiranda
Copy link
Collaborator

Seems that after processing the oobi all contact data is replaced in kere: https://github.com/WebOfTrust/keripy/blob/9d9a481994e01aaa5a1c7bc637f758a3a2927078/src/keri/app/oobiing.py#L507-L508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants