kodadot / kodadot/basick

Pre-indexed collections has incorrect count

Open
#34 1 comment 0 reactions 0 assignees View on GitHub
base
Dominant language
TypeScript
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

Some collections that were pre-indexed, does not calculate with the update of supply,
therefore
you have 7 items and one count

**To Reproduce**
Steps to reproduce the behavior:

- https://deploy-preview-10670--koda-canary.netlify.app/base/collection/0x724d751106fc124583a3a27476c3700e776d2796?page=Infinity

**Expected behavior**

I expect that
`select nft_count from collection_entity where id = ${id}`
should be equal to
`select count(*) as nft_count from nft_entity where collection_id = ${id}`

**Screenshots**

![Screenshot 2024-08-02 at 15 55 30](https://github.com/user-attachments/assets/3ea90f6b-40b5-48eb-9976-6b75ea631a1d)

![Screenshot 2024-08-02 at 15 58 45](https://github.com/user-attachments/assets/0377e101-723b-4491-af9e-9c205dd67354)

**Additional context**
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the pre-indexed collection shown at the reproduction URL and inspect how collection_entity.nft_count is updated against the nft_entity rows for the same collection_id. Compare the two SQL counts before and after supply updates. Done means the stored collection count matches the number of related NFT records.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.