Closed aroyer closed 7 years ago
Can you describe in more detail what the issue is that this is solving exactly, including a test case?
the internal Kitto.Notifier.cache has all keys as atoms for some reason by design (https://github.com/kittoframework/kitto/blob/master/lib/kitto/notifier.ex#L58). when you post using the API to a widget the json comes in as strings so the cache map can only update string keys but they are all internally stored as atoms. to conform with design on cache map with keys as atoms changing strings to atoms on json api posts. if you want to change internal data storage to strings that sounds better.
simple test to reproduce is post to widget with a key and try and get the value posted at that key back with a get and will notice its returning what was internally set by the job. in other words the atom key is fetched and can see in Kitto.Notifier.cache that there are 2 entries one as a string key and the other atom key. added a test here https://github.com/kittoframework/kitto/pull/109/files#diff-06b39c5def3218a2fa4fd995a7db8d99R338
I would suggest that we change the cache to use string based keys instead of atoms if we're to allow interacting with them through a public interface.
@aroyer First I want to thank you for spotting this and trying to fix it. We have concluded to change the cache keys to strings. I've made the required changes on a branch. Can you adapt your PR to these changes?
@aroyer I made the required changes to have this resolved (see: d91d015d).
Thanks again for getting involved!
thank you much for the fix and the great framework.
…perly