Skip to content

Post meta is never actually deleted on the receiving end #284

Open
@helen

Description

@helen

Noticed in #258 / #259:

set_meta() never actually deletes any post meta. This appears to always have been an issue but was exacerbated by a bug we introduced in 1.3.4 that was duplicating empty meta values that are now kind of stuck in place because of the way update_post_meta() works with previous values.

I don't yet know what the right thing to do is. We could:

  • Be less performant and just wipe out everything not blacklisted before adding again
  • Try to do some trickery with slicing the existing meta arrays down and matching up against the length of the new data and deleting the ones that are no longer represented. The issue with this is that for these situations where we have duplicated values (I don't know if there's ever a time where that's a valid thing people want to do??) it will wipe out all of the post meta with that same value regardless of how many items there are supposed to be. They will get added back, presumably, but that still seems like a weird routine.
  • Something else I haven't managed to think of yet

I guess the biggest question to start is: what kind of situations would there be where the distributed post has meta that the origin post did not have and need to keep?

@tlovett1

Metadata

Metadata

Assignees

Labels

needs:discussionThis requires discussion to determine next steps.type:bugSomething isn't working.

Type

No type

Projects

  • Status

    In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions