Open lenkan opened 1 week ago
The problem here is the long running operation is related to the OOBI and not the contact. The OOBI has been previously resolved (and is never removed (we don't unresolve for contact deletion)) so the operation is done: True
immediately - while the actual second client call to oobi().resolve()
is still processing again and creating the new contact.
I think the cleanest solution might be to have a new OpTypes.contact
that is returned if the alias is specified instead of OpTypes.oobi
. What do you think?
The problem here is the long running operation is related to the OOBI and not the contact. The OOBI has been previously resolved (and is never removed (we don't unresolve for contact deletion)) so the operation is
done: True
immediately - while the actual second client call tooobi().resolve()
is still processing again and creating the new contact.I think the cleanest solution might be to have a new
OpTypes.contact
that is returned if the alias is specified instead ofOpTypes.oobi
. What do you think?
Thanks for putting some thought into it! I agree that would be cleaner. I think we can even take it one step further even - what if the "resolve oobi" is completely independent from contacts. If you want to add a contact you would POST / PUT a contact resource that contains alias and AID. The creation of contact would fail if the oobi is not yet resolved.
This is what we have to do often times anyway if we want to add more attributes to the contact.
If we do it that way, the resolving of an oobi would never affect the contact database.
What do you think?
Yeah I wouldn't be opposed to that since the second call would be necessary anyway for the attributes, and the OOBI resolution is idempotent if it fails before creating the contact.
This is inherited from keripy though so we'd have to see if it makes sense with @pfeairheller and others.
Steps to reproduce
Actual result
HTTP 404 is returned.
Notes
See reproduction https://github.com/nordlei/vlei-sandbox/blob/main/src/issues/contact-not-added-after-deletion.test.ts
It seems like the contact attributes are removed from the contact.
See test
It looks like I need to add a delay after the operation has resolved before the contact is properly added to the list of contacts.