Skip to content

refactor: simplify state of fs store entry #102

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 40 commits into from
Aug 6, 2025
Merged

refactor: simplify state of fs store entry #102

merged 40 commits into from
Aug 6, 2025

Conversation

rklaehn
Copy link
Collaborator

@rklaehn rklaehn commented Jul 9, 2025

Description

A few things were stored twice, just to enable Drop. Now we don't need Drop anymore and can store them only once.

BaoFileHandle was a wrapper around a BaoFileHandleInner, which had the actual BaoFileStorage as well as the additional info needed to be able to implement Drop. Now we don't implement Drop anymore and can just pass in the required extra info in the persist call from on_shutdown!

In several other places we now have to give additional info when working with BaoFileHandle, but this is conveniently grouped in HashContext.

Breaking Changes

None

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@n0bot n0bot bot added this to iroh Jul 9, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Jul 9, 2025
Copy link

github-actions bot commented Jul 9, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-blobs/pr/102/docs/iroh_blobs/

Last updated: 2025-08-05T10:55:20Z

@rklaehn rklaehn force-pushed the slim-down-state branch from 9188c0a to 27df6da Compare July 9, 2025 14:28
Base automatically changed from entity-manager to main August 5, 2025 10:31
@rklaehn rklaehn marked this pull request as ready for review August 5, 2025 10:52
We are just destructuring a Command::Spawn that we have created a few lines before.
@rklaehn rklaehn requested a review from matheus23 August 5, 2025 10:58
@@ -400,7 +400,7 @@ mod main_actor {
match e {
mpsc::error::TrySendError::Full(cmd) => {
let entity_actor::Command::Spawn(spawn) = cmd else {
panic!()
unreachable!()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Forgot to do this in the last PR!

@rklaehn rklaehn merged commit ef1d1df into main Aug 6, 2025
26 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants