passport-sdk icon indicating copy to clipboard operation
passport-sdk copied to clipboard

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

Open shavinac opened this issue 3 years ago • 1 comments

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 avatar Jul 05 '22 16:07 shavinac

Related to https://github.com/gitcoinco/passport-sdk/issues/13 for the @gitcoinco/passport-sdk-reader package

shavinac avatar Jul 12 '22 20:07 shavinac