Skip to content

fix: decode the post.uuid before comparing it with other uuids#587

Open
dmaljovec wants to merge 2 commits intoairbnb:masterfrom
recursionpharma:fix-uuid-matching
Open

fix: decode the post.uuid before comparing it with other uuids#587
dmaljovec wants to merge 2 commits intoairbnb:masterfrom
recursionpharma:fix-uuid-matching

Conversation

@dmaljovec
Copy link
Contributor

@dmaljovec dmaljovec commented Oct 24, 2020

What?

We encountered a problem where the uuid of our posts looks like a hex string, but it is being compared with bytes on the kr_dir and kp objects. This bit of logic ensures we are comparing apples to apples by forcing the post.uuid to be decoded if it is a hex string and coercing it to a bytes object as comparing a str to a bytes will never result in equality.

Why?

The reason for this change, is that any update to our knowledge repo becomes a reindex of all posts which means our consumers have to wait to see their new posts. This should drastically reduce the amount of work per reindex operation.

Description of changeset:

  • Change how post.uuid is compared to existing data.

Test Plan:

  • Make an edit in a repository and ensure the resulting update_index that gets triggered does not rewrite everything.

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