-
Notifications
You must be signed in to change notification settings - Fork 10
handle delete when message id bytes #23
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
Conversation
|
@mlasevich ☝️ 😃 |
|
My apologies, will take a look |
mlasevich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It pays for me to replicate the issue locally to understand it better. Now that I look at it. its pretty bad. Thanks for the contribution.
| if int(result[0]) == 1 and int(result[1]) > 0: | ||
| # 1 key deleted from zset | ||
| # 3 keys deleted from hash (message itself, receive count, first receive field) | ||
| if int(result[0]) == 1 and int(result[1]) == 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a scenario where result[1] > 0 but not 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, unless the number of keys stored per message in the hash changes. From what I could tell, the message, receive count, and first receive are always there, so if there are not deleted then there would be some sort of problem. That was my thought process around this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense.... BTW, it is out as v0.6.1 🤞🏻
|
|
||
| # decode to string when provided as bytes | ||
| if isinstance(message_id, bytes): | ||
| message_id = message_id.decode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid issues with tx.zrem() we may want to adjust the message id specifically for generated rc/fr keys - but it seems to work fine as-is
Decode message_id to
strwhen it is provided asbytes.Closes #17