Skip to content

stop mutating the original document on save - #181

Open
langalex wants to merge 1 commit into
1.xfrom
dont-mutate-before-save
Open

langalex wants to merge 1 commit into
1.xfrom
dont-mutate-before-save

Conversation

@langalex

Copy link
Copy Markdown
Owner

but only after a successful save

this allows code to access the original document from within the save block.

but only after a successful save
return save_document_with_conflict_handling(document, options, retries, &block)
end

working_copy = document.dup

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Will this work for complex objects?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

nope

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

i'm afraid that's a hard problem though

@langalex langalex changed the title stop mutating the original docuent on save stop mutating the original document on save Sep 29, 2026
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.

2 participants