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(website): Fix infinite loop in scenegraph example #9248

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented Nov 14, 2024

Currently the scenegraph example makes infinite continuous requests for all.json locally for me. On the production website I'm not seeing anything because the OpenSky API returns 429s, but it might be that my IP address has just been rate limited.

I think the current behavior leads to continuous requests, because data is assigned in the loop callback, but data is also a dependency of the effect so these changes trigger more requests. I've refactored a bit and this fixes the issue locally, but I'm still blocked by the OpenSky API and can't test with real data.

Aside - Given that it only updates every 60s, maybe it'd be simpler (for purposes of showing a scenegraph example) to make a single request and skip the refresh cycle?

@coveralls
Copy link

coveralls commented Nov 14, 2024

Coverage Status

coverage: 91.626%. remained the same
when pulling e314d5a on donmccurdy/fix-scenegraph-example-infinite-loop
into 81371bf on master.

@donmccurdy donmccurdy force-pushed the donmccurdy/fix-scenegraph-example-infinite-loop branch from 7bea8a5 to e314d5a Compare November 14, 2024 19:11
@donmccurdy donmccurdy merged commit 4574c5e into master Nov 14, 2024
2 checks passed
@donmccurdy donmccurdy deleted the donmccurdy/fix-scenegraph-example-infinite-loop branch November 14, 2024 19:18
@felixpalmer
Copy link
Collaborator

Aside - Given that it only updates every 60s, maybe it'd be simpler (for purposes of showing a scenegraph example) to make a single request and skip the refresh cycle?

I think the focus of the examples should be to showcase cool functionality, even at the expense of more complex code. It's nice to have it to example of live data with transitions. The docs already have a minimal example

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.

4 participants