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

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

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

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