-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add API to get created contest list #9
Comments
Alright, so initially contests are all created by the server, so there's no way the wallet will be able to help us compile this list. The list simply has to come from the server (where it's easy to compile). In theory, this list could be hundreds or thousands of contests in size, so I don't want to fetch them all at once, but a few at a time... We already have infrastructure in place for this (the contest generator), so let's use it! In backend.capnp, I can update the This also requires updating Also, I'm now discussing having the client ask for data for a particular user. Make sure we manage the security aspects of this to ensure that the data is either nonsensitive, or is authenticated to ensure the requester has access to it. For instance, creators of contests will likely be public information, so anyone can ask for a list of contests anyone has created. What contests are appearing in a given user's feed is not public, and should not be disclosed to just anyone. It's probably a good idea not to take an argument on whose feed is being requested, but to let the server determine this from authentication data. I always prefer to design APIs such that if the client shouldn't be able to do something, there's simply no way to ask for it. |
After further discussion with @akernest we think it would be better to have two types of contest generator: a customized feed generator, and a general search results generator. The search results generator will support all the other types of query, such as contests by creator, by coin, by search terms, etc. This second type of generator will also need to support specifying a sort order of results. The design for the API call for the search generator is still in the air, but what I'm thinking right now is a call that takes a list of "filters" which have a type (search term, contest coin, contest creator...) and any arguments which are relevant for that filter, and a list of sorting priorities to order the results. |
Eventually, we may want to refactor this to have the QML construct the filters to expose maximum flexibility to the GUI; however, this is much more elaborate and isn't needed for MVP. Also, it may be desirable to have the server do something more intelligent when 'searching' contests than just return the same list as the feed returns; however, this could also be postponed until making a real blockchain-based implementation (why waste so much effort creating an elaborate stub?)
Resolve #9: Add early APIs for filtered contest generators
Currently the GUI has no way of getting the list of contests which the current user has created. Add a call to
VotingSystem
orChainAdaptorWrapper
for this.The text was updated successfully, but these errors were encountered: