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

Active polls cache fix #805

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Active polls cache fix #805

merged 1 commit into from
Jul 20, 2023

Conversation

hernandoagf
Copy link
Collaborator

What does this PR do?

It ensure the partial-active-polls are re-fetched if their cache key is not valid or not found

@vercel
Copy link

vercel bot commented Jul 18, 2023

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

Name Status Preview Updated (UTC)
governance-portal-v2 ✅ Ready (Inspect) Visit Preview Jul 18, 2023 11:12pm

@what-the-diff
Copy link

what-the-diff bot commented Jul 18, 2023

PR Summary

  • Improved Error Handling in fetchPolls.ts File
    Previously the code's structure could potentially lead to some errors or unexpected results due to attempting to work with undefined variables. Now these risks have been mitigated by adding a fallback value to partialActivePolls - if it doesn't hold any values, it will be assigned a value of newPartialActivePolls.

  • Enhanced Code Flexibility
    The way activePollIds is assigned has been tweaked to make the code more resilient and able to handle more diverse situations. With the introduction of optional chaining, the code can navigate through complex objects and arrays without causing errors if a reference or function is undefined. The nullish coalescing operators offer a more precise way to fallback to a default value when dealing with a possible null or undefined variable.

This will contribute in reducing possible runtime errors and increase the accuracy of poll-fetching function.

@hernandoagf hernandoagf merged commit 2133426 into develop Jul 20, 2023
2 of 4 checks passed
@hernandoagf hernandoagf deleted the partial-active-polls-fix branch July 20, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants