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

WIP fix: concurrency issues with async requests #328

Closed
wants to merge 1 commit into from

Conversation

katiestahl
Copy link
Contributor

@katiestahl katiestahl commented Sep 5, 2024

My plan of attack is to have a class that handles api requests and aborts them based on keys passed in on subsequent requests.

This is better than adding a debounce, since this can aid with flexibility. (user can still make changes and requests will appear instant, no need to wait for debounce)

I'm wondering about the keys, though. Those will update whenever a user makes changes to the elements. So they need to be similar enough to know that a user is still editing whatever item(s) they're editing but different enough to where, say a user is adding a fusion with two transcripts, that both requests can be made without impacting each other.

idea: maybe pass in the id of the drag n drop element and use that as a key for the abort controller?

@katiestahl katiestahl added bug Something isn't working help wanted Extra attention is needed priority:high High priority labels Sep 5, 2024
@katiestahl katiestahl self-assigned this Sep 5, 2024
Copy link

github-actions bot commented Sep 9, 2024

This PR is stale because it has been open 1 day(s) with no activity. Please review this PR.

@github-actions github-actions bot added the stale label Sep 9, 2024
@katiestahl
Copy link
Contributor Author

I might get rid of this PR and approach this problem differently. This isn't quite working how I had hoped, and I found another solution that may get us closer to what we want. Namely, one change that will partially solve this issue is fixing the dependency array in the useEffect for the tx segment element. There's still some issues that I'm working out (ie; with this solution, if you add a new item, it will get deleted when the request comes back) but we may not need the api service I implemented in this PR

@github-actions github-actions bot removed the stale label Sep 11, 2024
@katiestahl katiestahl closed this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed priority:high High priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant