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

Only revision existing metadata #55

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

aaemnnosttv
Copy link
Contributor

This PR updates the logic for meta which is created on the revision.

Currently, a post meta entry is created for every revisioned meta key, whether it exists or not.

This adds a simple check to see if the meta exists first and only creates an entry on the revision if it does.


Also included are updates to the test case to cover this change as well as a few enhancements to the test case itself:

  • Adds the ability to more easily control which revisioned meta keys to use on a per-test basis
  • Adds a few assertion helper methods for checking if a post has a particular meta key or not

Resolves #32

@adamsilverstein
Copy link
Owner

Hey @aaemnnosttv thank you for the PR, the is excellent!

My only concern here would be to ensure the revisioned meta matches the post state, previously I had tried getting the meta and found issues with that (described here #32 (comment)). I feel like using metadata_exists nicely solves this - I was somehow unaware that function existed.

Before merging I'd like to test this with storing blank and false values to meta, to make sure those values are still revisioned. It would be great to get test coverage for that as well.

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.

Revisions meta entries created when not needed
2 participants