You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the API calls with potentially voluminous results are pageable via LastPostHashHex. However, the GetNFTsForUser route returns an "NFTsMap" as a single object. This object can be huge, depending on the NFT project. Consequently, this particular data structure does not seem well-suited for long-term scalability.
I think we should return an array of NFTsMap that is pageable in the response. That way, we can page the results by passing in the LastPostHashHex, similar to other calls.
Otherwise, devs are forced to use GetPostsForUser route and "filter" the posts to NFTs. This causes a F/E performance hit, because we are making unnecessary calls, and TTFP (time-to-first-paint) suffers as well.
UPDATE - Also, the IsForSale boolean value is basically ignored. When the value is set to null, it should return all NFTs for a public key, regardless of the IsForSale status. However, this does not work properly, as only NFTs with IsForSale = true are returned.
The text was updated successfully, but these errors were encountered:
AdonousTech
changed the title
Rationale for Returning NFTs Map in Non-Iterable Response
Rationale for Returning NFTs Map in Non-Pageable Response
Dec 8, 2021
Most of the API calls with potentially voluminous results are pageable via LastPostHashHex. However, the GetNFTsForUser route returns an "NFTsMap" as a single object. This object can be huge, depending on the NFT project. Consequently, this particular data structure does not seem well-suited for long-term scalability.
I think we should return an array of NFTsMap that is pageable in the response. That way, we can page the results by passing in the LastPostHashHex, similar to other calls.
Otherwise, devs are forced to use GetPostsForUser route and "filter" the posts to NFTs. This causes a F/E performance hit, because we are making unnecessary calls, and TTFP (time-to-first-paint) suffers as well.
UPDATE - Also, the IsForSale boolean value is basically ignored. When the value is set to null, it should return all NFTs for a public key, regardless of the IsForSale status. However, this does not work properly, as only NFTs with IsForSale = true are returned.
Thoughts?
https://github.com/deso-protocol/frontend/blob/d98a71502851b4a22f1fc251597f8c700145a14d/src/app/backend-api.service.ts#L980
The text was updated successfully, but these errors were encountered: