-
Notifications
You must be signed in to change notification settings - Fork 11
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
Back-end dependencies for the new Backpack V2 #206
Comments
It is not clear from the design why we need to include several collections. Also, it may blow up as the length of the URL may exceed the limit. In that case I would recommend to use a body instead |
According to the design of the new Backpack, we can load in the same grid and at the same time different collections of wearables. For example: Base wearables (swiching off the ONLY COLLECTIBLES toogle) + Owned wearables (selecting Decentraland from the COLLECTION dropdown) + one or more Third Party wearables (selecting one or more TPW collections from the COLLECTION dropdown). In a situation like this, we're going to need to be able to apply pagination/sorting/searching on all of these collections together, so we would need to be able to request them together.
Yes, it would be a good solution for this case where we would have to send a list of ids. |
Considering that we introduce more dimensions we should be very smart with pagination and caching. I see the following potential risks:
I would consider cooperating with the "platform" team on this problem as they should have some sort of caching/grouping or other mechanisms that allow fetching wearables faster. Maybe we should revise endpoints to select excessive wearables upfront taking into consideration other dimensions. Have you thought about it? |
Few more comments from my side:
|
|
|
layout: adr
adr: 206
title: Back-end dependencies for the new Backpack V2
date: 2023-04-04
status: Review
type: ADR
spdx-license: CC0-1.0
authors:
Need
This is a technical proposal for the needs described here: PRD: Backpack V2
The intention of this document is:
Involved teams
This initiative will require a cross team effort that will include the following teams:
Back-end dependencies
We currently have several lambdas endpoints (some of them compatible with pagination) that are already being used by the current version of the Backpack to retrieve the information about the wearables. These endpoints are:
/lambdas/collections/wearables?collectionId=urn:decentraland:off-chain:base-avatars
/lambdas/users/:userId/wearables?includeDefinitions=true
/lambdas/users/:userId/emotes?includeDefinitions=true
/lambdas/users/:userId/third-party-wearables/:collectionId&includeDefinitions=true
We need to support the features in the lambdas. It is recommended to create new ones, to keep retro-compatibility, but we leave the decision to the @platform team.
Filter WEARABLES by collection
In order to give the user the possibility of seeing and managing any type of wearables (BASE, OWNED and THIRD PARTY) together in the backpack, we would need to receive all the information from a single endpoint instead of having to request them separately.
These will be the filters available in the UI to filter the wearables:
Show BASE WEARABLES ON/OFF
Select 1 or more COLLECTIONS ("decentraland" would be the owned wearables and any other would belong to TPW)
In order to be able to manage these filters, we will need an endpoint where we can specify a list of collection ids (either "Decentraland", "urn:decentraland:off-chain:base-avatars" or any third party collection) and return the list of wearables that match with those collections.
Examples:
Only owned collection
Only base collection
Several third party collections
Any combination
Filter EMOTES by collection
In order to give the user the possibility of seeing and managing any type of emotes (BASE or OWNED) together in the backpack, we would need to receive all the information from a single endpoint instead of having to request them separately.
This will be the filter available in the UI to filter the emotes:
Show BASE EMOTES ON/OFF
In order to be able to manage these filters, we will need an endpoint where we can specify a list of collection ids (either "decentraland" or "base") and return the list of emotes that match with those collections.
Examples:
Only owned collection
Only base collection
Any combination
Filter WEARABLES/EMOTES by text
The user will be able to filter the wearables/emotes by text.
In order to be able to do it, we will need to add a new parameter to the existing endpoints that will be used to specify a text and return the list of wearables that match with that text. The new parameter will be called
textFilter
and will be a string that will accept any value.In order to be able to manage this filter, we will need an endpoint (the same described in the previous sections) where we can specify a text and return the list of wearables that match with that text.
Examples:
Filter any combination of wearables by text
Filter any combination of emotes by text
Filter WEARABLES by category
The user will be able to filter the wearables by category.
In order to be able to manage this filter, we will need an endpoint (the same described in the previous sections) where we can specify the category and return the list of wearables that match with that category.
Examples:
Filter any combination of wearables by category
Sort WEARABLES/EMOTES
The user will be able to sort the wearables/emotes by different criteria: newest/oldest, rarest/less rare or name A-Z/name Z-A.
In order to be able to manage this sorting, we will need an endpoint (the same described in the previous sections) where we can specify the sorting criteria and return the list of wearables sorted by that criteria. The sorting parameter will be a string that will accept the following values:
newest
oldest
rarest
less_rare
name_a_z
name_z_a
In cases where wearables or emotes dont have minted timestamps, they should be added at the bottom of the list.
Examples:
Sort any combination of wearables by rarest
Filter any combination of emotes by name A-Z
Get wearable market details (NEW ENDPOINT)
The user will be able to click on a wearable and open a modal with some details as:
To be able to request this information, the client will have to use the minted id instead of the generic id. This information is available when querying the wearables.
In order to be able to get this info, we will need to create a new endpoint that will return the details of a specific wearable:
Example:
Get market details of a specific wearable
Get a random list of equipped wearables (NEW ENDPOINT)
The user will be able to click on a [RANDOMIZE] button and equip a random list of wearables on his avatar.
In order to be able to do it, we will need to create a new endpoint that will return a random list of wearable ids from the owned wearables of the user.
The wearables must be from each category, avoiding conflicts with hides and replaces whenever possible.
Example:
Get random wearables of a specific user
Outfits
The outfit information should be stored in the catalyst because we need to support multi-platform.
On the other hand, we should avoid storing it in profiles since it is information that only each individual user needs and does not need to be shared with other users.Adding it to the profiles would add an additional data transfer for each request unnecessarily.
Update: The outfit information will be stored in the user profile.
Regarding to the outfit image previews, they can be generated in the client when saving the outfit.
There is no need to store the images in the catalysts.
We may encounter the need of checking that the wearables in the outfit are valid for the current user. (What happens if the user does not have the wearable anymore?)
Equip/save wearables
We though about several alternatives to avoid performance issues by saving the profile every time you equip an item:
Saving the profile would mean that the nearby users will be able to see the changes as soon as possible.
Update: we will go for option 1, taking in consideration that we cant save the profile during the quitting of the application. It will only be saved when closing the backpack, just like the "save" button worked before.
Emotes pagination
We will need to refactor the current emotes catalog, the same way on how we did on wearables catalog, so its supports pagination.
We will also reduce kernel responsibilities, moving all (or most) of the emote handling in the renderer.
No need backend support.
Open ticket: #4429
BackpackEditorV2
In Unity we are going to implement a new UI for the backpack v2 requirements, including all the components needed.
We will keep retro-compatibility with the old one, including the UI, service calls and dependencies.
Open questions
The text was updated successfully, but these errors were encountered: