I’m building an instant messenger but have an issue I’m trying to resolve.
I encrypt the messages prior to pushing to parse and then decrypt the message when it’s pulled. I have a little decryption animation that fires while waiting on the message to decrypt and be displayed in the dom.
Like any other instant messenger I have the option to select an emoji to react to a message and those reactions are stored as a key:value array in that message’s column in the Parse class.
When that new reaction is added or someone changes their reaction it fires the live query update subscription listener which is needed so that the new emoji is displayed there.
I also have the ability to edit your own messages.
My issue is that the message being reacted to gets repulled and goes through the decryption process again. This is a crappy UI since the message itself isn’t updating so it shouldn’t be redecrypting and updating the message itself, plus I don’t want to go through the overhead of re-decrypting something I don’t need to.
Is there anyway to pass into the live query subscription listener on which column was updated so I could prevent the decryption effect from firing on the main message in this case?
I have no way of telling if the new value matches the existing value prior to firing the decryption message client side because the value being passed from Parse is an encrypted string and what is displayed is the decrypted value. I can at least prevent the UI from being wonky by at least checking if the DECRYPTED value matches the displayed value but the fact still remains that I’m eating the overhead of running decryption when I don’t need to.
Looking through the docs I’m not really finding any way to determine what column within a row was updated at all unless I’m missing something?