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

[writer] getPassport should return different errors/values for no passport vs. network errors #8

Open
shavinac opened this issue Jul 5, 2022 · 1 comment

Comments

@shavinac
Copy link
Contributor

shavinac commented Jul 5, 2022

This is useful for "stamp-writer" applications such as Gitcoin Passport, where there is different behavior for situations where the user truly does not have a passport, as opposed to a network error/timeout causing passport-holder-status to be unknown/undetermined.

See getPassport logic used in Gitcoin Passport in database-client package. Ideally more descriptive errors/enums would be returned, such as a custom NetworkError / NoPassportError etc.

Also, sometimes the Passport retrieved from Ceramic will be an empty object {} - this occurs as an intermediary state while the Passport is still in the creation process. From Ceramic team:

whenever a record is added to IDX, the stream is first created with empty content {}, then updated to set the content to what was provided. So if you load a stream right in that window while it's in the process of being created you could temporarily see empty content like that
that is done because IDX uses deterministic streams and deterministic streams are always created without content to allow the genesis commit to be deterministically generated off of the stream metadata alone

@shavinac
Copy link
Contributor Author

Related to #13 for the @gitcoinco/passport-sdk-reader package

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

No branches or pull requests

1 participant