enforcing pickle to use copy of dict while serializing extra context of the notification
This fixes a type of notification extra context pickling in our case (remove was failing as key not found).
Example that satisfies the condition: import pickle x = {'order_number': 'X', 'deal_url': 'J'}
pickle.dumps(x) pickle.dumps(pickle.loads(pickle.dumps(x))) pickle.dumps(pickle.loads(pickle.dumps(pickle.loads(pickle.dumps(x)))))
Where 1 and 3 are same but second is different.
Which feed class and with which storage backend did you run into this problem?
Thanks for contributing, we really appreciate it.
Part of the problem seems to be that: https://github.com/tschellenbach/Feedly/blob/master/feedly/storage/redis/timeline_storage.py#L91
Removes by value instead of by key. Not sure why this is.
Think we could easily use http://redis.io/commands/zremrangebyscore over there
Hi,
I have used current redis version with following notification class:
class NotificationFeedly(RedisNotificationFeed): key_format = 'custom_feed:notification:%(user_id)s'
Debugged down to zrem which returned 0 as value is not found.
I also agree using rembyscore which might be a reliable and faster solution. We will keep fork and switch back to main rep in case any changes on serialization or zrem.
Thank you
Solution #1191a64 doesnt resolve a case with nested dicts. Recursive algorithm will.