The problem is that when you use the command set_on
It will use the action set. Not push.
(You think you are pushing, but your just setting. Which is functioning normally by overwriting all data)
You would need a push_on command (not developed by proboards)
Your 'push' should be the object id of the user. Except a Forum Key does Not Use an Object ID at all.
MY SOLUTION
pb.plugin.key("updated_threads").push({value: keyData, error: function(error) {if(error.code == 64){ var newarray = $.grep(Array(),function(n){ return(n) }); pb.plugin.key('updated_threads').set({value: newarray, success: function(){pb.plugin.key("updated_threads").push({value: keyData}) } });} } });
I use a less elegant solution to set a Super Forum Key.
It pushes to the key, and if the data type is error 64, it will set the key to a blank array so that it can be pushed to.
Now if you made some kind of attachment to the button they use to set the data, or possibly an ajaxcomplete or $(document).on (granted proboards sees it as 'setting a key by a user action'):
The result would be a key that stores data without the possibility of overwriting data.
Otherwise (the cheating way, Granted it should have updated data if an ajax request has been made right before you initiate. But I'm not sure if all ajax requests update a forum key's data)
It would look something like Every Time keyData Changes:
var originalkey =pb.plugin.key('updated_threads').get()
if(originalkey == undefined)
{keyData = [keyData]}
else {keyData = originalkey.push(keyData)} //assuming keyData was a string and now an array
pb.plugin.key('updated_threads').set_on('post_new', null, keyData);
I would assume an approach like that would work.
If you like something I have posted feel free to use, no permission required.
If you have further questions or understanding of a forum key/keys just tag me in a post, I use two forum keys in the Eshop plugin, so I have worked with them for around 4 months.
The real trick I have is how to remove an item from the middle of an array without overwriting or losing data
Also I would note that you should check and do some experimenting to find the size limit of your forum key and putting in a function that will prevent writing to the key before it overloads/explodes and kills your plugins