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

Force Persisted<T> to mutate and persist atomically #1541

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

evanlinjin
Copy link
Member

Description

@tnull asked why we have to do a separate .persist call when using Persisted<Wallet>. This is my solution to not having to do that.

Notes to the reviewers

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@evanlinjin evanlinjin force-pushed the mutate_wallet_and_persist_atomically branch from f8370ae to 8d58e7a Compare August 8, 2024 09:59
@tnull
Copy link
Contributor

tnull commented Aug 8, 2024

Thank you for looking into this! It seems like a viable option even though it somewhat complicates the wallet API.

Although, as noted on Discord, I personally might even prefer the current simpler API as long as it clearly communicates when persistence should/may happen (e.g., would return a result along the lines of enum PendingPersistence { Immediately, Eventually } for all codepaths that need persistence), and the docs would provide clear guidance how to handle persistence failures.

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.

None yet

2 participants