Skip to content

Being more defensive here around the potential for bad data #6479

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

jobelenus
Copy link
Contributor

How does this PR change the system?

Prevent exceptions. We were seeing a rare error where d was undefined so d.id threw an exception

@jobelenus jobelenus requested a review from jkeiser June 24, 2025 18:34
@jobelenus jobelenus marked this pull request as draft June 24, 2025 18:34
@github-actions github-actions bot added the A-web label Jun 24, 2025
Copy link

github-actions bot commented Jun 24, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

Scanned Files

None

We were seeing a rare error where `d` was undefined so `d.id` threw an exception
@jobelenus jobelenus force-pushed the fix/be-defensive-about-nullish-data branch from 09a303a to 6851856 Compare June 24, 2025 18:35
@jobelenus jobelenus marked this pull request as ready for review June 24, 2025 18:37
@jobelenus jobelenus added this pull request to the merge queue Jun 24, 2025
Merged via the queue into main with commit 2e8fb55 Jun 24, 2025
10 checks passed
@jobelenus jobelenus deleted the fix/be-defensive-about-nullish-data branch June 24, 2025 18:45
// TODO removal
const idx = cachedData.findIndex((d) => d.id === id);
const idx = cachedData.findIndex((d) => d && d.id === id);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should do this without at least adding an error log when we get a falsey value--defensive programming is good but we're probably missing something important here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy