Subgraph not indexing data in join phase
pettinarip opened this issue · 3 comments
We have a problem in the join phase with the current state of the subgraph. Basically, the subgraph is storing factory-related data only once a round has started.
So,
- if we are in the join phase
- no round exists (so, the
handleRoundStarted
handler is not triggered) - the subgraph does not have any data
- the UI does not have any data to display
IMPORTANT: this only happens in the first join phase (where there has never been a round). In the following join phases, we shouldn't have this problem.
IMO, in order to fix the problem, we need to index the factory data not when the round starts but when the factory initializes (basically in a different event). To do that, we need to:
- Set more events in the
FundingRoundFactory
contract - Listen to those events in the subgraph and refactor the existing
handleRoundStarted
I will create a PR soon to show this possible solution.
Heads up, you can just index the other registry contracts at the appropriate blocks on the subgraph manifest.
Oh good point! 🤯 thanks! forgot about that. Okok, so I guess we are covered with that. I'll try adding a new recipient to test the complete flow.
Aside from this specific problem, I think that we should have data in the factory entity regardless of whether we have or not have rounds but this is a low priority right now. We shouldn't have issues with the current state of the app.
I can confirm that we are tracking the recipients regardless of the factory.