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

Move RequestStore to top level of TUI state #377

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

LucasPickering
Copy link
Owner

@LucasPickering LucasPickering commented Sep 13, 2024

Description

Describe the change. If there is an associated issue, please include the issue link (e.g. "Closes #xxx"). For UI changes, please also include screenshots.

This moves RequestStore out of the view and into root state. This means we can use it to track in flight requests. In the future we'll use it for cancellation tokens too.

Known Risks

What issues could potentially go wrong with this change? Is it a breaking change? What have you done to mitigate any potential risks?

I'm not particularly fond of this code, especially the Rc<RefCell<_>> in TestHarness. I'll probably clean it up eventually but right now I just need to make progress. So the risk is poor maintainability.

The UpdateContext is also a bit of a regression, since it existed in the past and I moved everything to ViewContext. I'm trying to avoid needing Rc<RefCell<_>> in the ViewContext (especially since it already wraps the whole context in a refcell). By passing values around throughout the course of a single frame, we can rely on regular ass borrowing rules.

QA

How did you test this?

Existing test coverage is pretty good. Tested manually too.

Checklist

  • Have you read CONTRIBUTING.md already?
  • Did you update CHANGELOG.md?
    • Only user-facing changes belong in the changelog. Internal changes such as refactors should only be included if they'll impact users, e.g. via performance improvement.
  • Did you remove all TODOs?
    • If there are unresolved issues, please open a follow-on issue and link to it in a comment so future work can be tracked

This moves RequestStore out of the view and into root state. This means we can use it to track in flight requests. In the future we'll use it for cancellation tokens too.

I'm not particularly fond of this code, especially the Rc<RefCell<_>> in TestHarness. I'll probably clean it up eventually but right now I just need to make progress.
@LucasPickering LucasPickering enabled auto-merge (rebase) September 13, 2024 01:02
@LucasPickering LucasPickering merged commit 96b8000 into master Sep 13, 2024
15 checks passed
@LucasPickering LucasPickering deleted the http-state-mgt branch September 13, 2024 01:05
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.

1 participant