Skip to content
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

fix: tally result id collision #590

Merged
merged 1 commit into from
Jan 21, 2025
Merged

fix: tally result id collision #590

merged 1 commit into from
Jan 21, 2025

Conversation

kittybest
Copy link
Collaborator

@kittybest kittybest commented Jan 10, 2025

Description

This is to solve the tallyResult id collision on the subgraph, meanwhile make sure the interface works well after this change.

Because of the rebase issue, this is same PR as #584 & #583 , but branch from the latest main branch.

Additional Notes

I found that the interface mapping result with tally result never uses the result id, that's why we didn't find this problem before. We need to have 100% confidence that the subgraph returns tally result 1 by 1 following the index of the projects.
(So actually, maybe it's better that we use the result.id instead of the index of the loop?)

see here:

const results = tallyData.results.reduce((acc, tally, index) => {
const project = projects[index];
if (project) {
acc.set(project.id, { votes: Number(tally.result), voters: 0 });
}
return acc;
}, new Map<string, { votes: number; voters: number }>());

Related issue(s)

Confirmation

Important

We do not accept minor grammatical fixes (e.g., correcting typos, rewording sentences) unless they significantly improve clarity in technical documentation. These contributions, while appreciated, are not a priority for merging. If there is a grammatical error feel free to message the team.

@kittybest kittybest self-assigned this Jan 10, 2025
Copy link

vercel bot commented Jan 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maci-platform ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2025 6:06pm

@crisgarner
Copy link
Collaborator

Thanks! only have a question

Copy link
Collaborator

@crisgarner crisgarner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kittybest kittybest merged commit fadd203 into main Jan 21, 2025
17 checks passed
@kittybest kittybest deleted the fix/tally-result-id branch January 21, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants