You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@amark When I used .load(), didn't get all the data one time. Sometimes it skipped some data or return {}. I tried it with 17,000 random messages. I have no issue with on() or open(), once() and load() didn't return all keys that I expected. I have my own relay peer with AWS config in Heroku as well.
import Gun from 'gun/gun';
import 'gun/sea';
import 'gun/lib/radix';
import 'gun/lib/radisk';
import 'gun/lib/store';
import 'gun/lib/rindexed';
import 'gun/lib/open';
import 'gun/lib/load';
import 'gun/lib/then';
const opt = {
peers: ["http://localhost:8765/gun"],
localStorage: false
};
const gun = Gun(opt);
gun.user().auth(userKeyPair, (ack) => {
if (ack.err) {
console.log("Doesn't exist");
} else {
const date = new Date().toISOString();
const payload = {
sender: {
id: "346463",
name: "John Doe"
},
createdAt: "2023-10-26T20:17:53.583Z",
text: "Hello world"
};
const messageRef = gun.user().get("messages").get(date).put(payload);
gun.user([chatroom pub key here]).get("messages").get(date).put(messageRef, null, {opt: {cert: "..."}});
setTimeout(() => {
// For the first time app loads only like restoring data
gun.user().get("messages").load(messages => console.log(messages));
}, 1000);
}
});
The text was updated successfully, but these errors were encountered:
@amark When I used .load(), didn't get all the data one time. Sometimes it skipped some data or return
{}
. I tried it with 17,000 random messages. I have no issue with on() or open(), once() and load() didn't return all keys that I expected. I have my own relay peer with AWS config in Heroku as well.The text was updated successfully, but these errors were encountered: