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

Clarification: can pub.Database.GetInbox and pub.Database.GetOutbox return an empty collection? #141

Open
BenLubar opened this issue Aug 11, 2020 · 1 comment

Comments

@BenLubar
Copy link
Contributor

Is there any downside to returning an empty collection from GetInbox and GetOutbox without even checking the database? The documentation implies that these functions are only used as a source for a collection object to pass to SetInbox and SetOutbox, and that the modified content will always be additive when used with these two methods.

@cjslep
Copy link
Member

cjslep commented Aug 12, 2020

You're correct, the GetInbox and GetOutbox on the database is for its own SetInbox and SetOutbox. go-fed will prepend any IRIs to any existing orderedItems property. If you return an OrderedCollection with no orderedItems property, it should create a new one.

Note that the GetInbox on FederatingProtocol and GetOutbox on the CommonBehavior are meant for handling the HTTP requests from peers and sending a OrderedCollection or OrderedCollectionPage in the response.

I'm open to suggestions on improvements (API, documentation, etc).

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

2 participants