Skip to content

[Feature Request]: Add information about failed attempts. #3

@MasterJ93

Description

@MasterJ93

Summary

The returns statement should display the successful result, as well as any failures from other places.

Pain points

Right now, there are only two states when resolving a handle: a successful state (where it gives out the decentralized identifier (DID)), or an unsuccessful state (where it times out, suggesting that it failed to resolve the handle). This isn't enough: there might be cases where it failed because it simply took too long to resolve it (which is rare, but is still possible, especially in a situation where the device has a slow internet connection (e.g.: 4G network and far enough from different towers to create a near-dead zone), or because it genuinely can't find anything. The developer needs to know why it failed. In HandleResolver.resolve(), the method will simultaneously search through multiple places: DNS, /.well-known/atproto-did, and backup servers. Whichever one comes first with a successful resolution of the DID will hand over the DID. This is fine, but there may be applications that want to know if the other connections were successful or not. Right now, ATIdentityTools doesn't offer this functionality.

Considered Alternatives

We can leave it with the timeout error, but it's missing why it timed out. Furthermore, there will simply be situations where it finds something, but it's not related to the AT Protocol.

Is this a breaking change?

No

Library Examples

No response

Additional Context

We could, potentially, create a new resolve() method, where it returns a tuple: the first item is either a DID or nil; the second item is a struct that has all of the information, such as the results of the DID verification methods (status and values of TXT record, DID syntax, and Public DNS resolvers) and HTTP verification method (status and value of HTTPS endpoint).

We'll also need to beef up the error handling of the original resolve() method to give this information when throwing the error. However, this error would be thrown only neither the DID or HTTP verification methods fully fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions