Skip to content

Conversation

harrytmthy
Copy link
Owner

Summary

Introduce a read barrier to ensure SafeBox getters block until the initial hydration completes, matching SharedPreferences semantics.

Implementation Details

  • Added awaitInitialReadBlocking() in SafeBoxStateManager to synchronously await the initial read if not yet complete.
  • Updated all getXxx() and getAll() accessors to invoke this barrier before returning values.

Closes #71

@harrytmthy harrytmthy added this to the 1.2.0 milestone Aug 26, 2025
@harrytmthy harrytmthy self-assigned this Aug 26, 2025
@harrytmthy harrytmthy added the enhancement New feature or request label Aug 26, 2025
@harrytmthy harrytmthy merged commit e219928 into main Aug 26, 2025
3 checks passed
@harrytmthy harrytmthy deleted the feature/add-initial-read-barrier branch August 26, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure reads await initial hydrate to match SharedPreferences behavior
1 participant