amark on master
unbuild - PUBLISHED! 1238 (compare)
amark on master
SEA - Update sea.work to suppor… (compare)
amark on master
stupid cache miss kills me all … (compare)
flutter_js
, but I thought how gun run in Flutter without localStorage or indexedDB .. or this would be a future feature?
let's say there is a common node where all users store data,
if a user did something like
let message = await gun.user().get('all').set({ msg: 'hello'})
gun.get('messages').get('first_message').put(message)
later you can do this:
let data = await gun.get('messages').get('fist_message')
let alias = gun.user(data).get('alias')
// retrieve all available users
gun.get('users').map().on(ui.show.users)
I've found a strange behavior. I'm not sure if that's a bug or it works as designed but here is a code
let room = SEA.pair()
let user = SEA.pair()
let cert = await SEA.certify(
'*',
{ '*':'posts', '+': '*' },
room
)
await gunRoom.get('posts') // => undefined
await gunUser.user().auth(user)
await gunUser.get('~' + room.pub).get('posts').get(user.pub).get('messages').put({message: 'hello'}, null, {opt: {cert: cert}})
gunRoom.user().get('posts').get(user.pub).get('messages') // => {message: hello}
gunRoom.user().get('posts').get(user.pub).put(null)
gunRoom.user().get('posts').get(user.pub).get('messages') // => undefined
gunRoom.user().get('posts').get(user.pub).set(null)
gunRoom.user().get('posts').get(user.pub).get('messages') // => {message: hello}
the whole thing is in a difference .put(null) vs .set(null)
we can go a bit further with it
await gunUser.get('~' + room.pub).get('posts').get(user.pub).get('messages').put(null, null, {opt: {cert: cert}})
gunRoom.user().get('posts').get(user.pub).get('messages') // => undefined
await gunUser.get('~' + room.pub).get('posts').get(user.pub).get('messages').set(null, null, {opt: {cert: cert}})
gunRoom.user().get('posts').get(user.pub).get('messages') // => {message: hello, ku33iqysRfusABH: null}
when the owner of the message .set(null) it reverts the nullified by .put(null) document with some extra hash key with a null value
let someArr = ['test', 'tests', 'testing']
for(let i = 0;i < someArr.length;i++){
gun.get(someArr[i])
}
gun.once(data => {console.log(data)})
let someArr = ['test', 'tests', 'testing']
for(let i = 0;i < someArr.length;i++){
gun.get(someArr[i])
}
gun.once(data => {console.log(data)})
vs
gun.get('test').get('tests').get('testing').once(data => {console.log(data)})
Gun
to your scope, so you dont need to import it twice, just initialize it afterwards
@daviddahl wow :D a decade+ ahead. Let's get this off the ground this time around?
@dweorh_twitter hmm, will look how to get this supported, can you submit as a GitHub Issue and tag mimiza?
<3 https://github.com/amark/gun/wiki/ can edit in-browser! :) Would be really appreciated, thanks!
@mmalmi :clap: :clap: :clap: let me retweet!!! 3rd is message
which is different every time, while as event
is the listener.
@sahaabhishek :wave: :) hiii!! :clap: @dweorh_twitter :clap: @lmangani:matrix.org . Browser WebRTC still needs "signaling" peers :( so relays default choice with websockets.
@abow reporting videos auto-play @estebanrfp
@devshendy Hiii! :clap: @adam-12:matrix.org . And RN, maybe someone can help with flutter.
@abow await gun.user(pubkey).get('epub)
@dweorh_twitter .set(null
is like pushing null into an loosely sorted array. It won't null out other things, put(
must. If GUN cannot find the UUID/soul of something, it will generate it as deterministically as possible based on the path - so that is why you see it "reappear" its the same ID, I believe .put(
docs API discusses this. If you want to start a "new" object at a path, make sure its a random ID.
@azdez:matrix.org you're missing gun = gun.get...
in your loop :) else gun never changes. (prob do ref = gun
outside and ref = ref.get(
inside, so you don't lose your root gun).
@WTFDoc :clap: @lmangani:matrix.org . GUN likes to remember... even via other browsers. But if you localStorage.clear()
at beginning of every refresh, and keep relay without storage... you should see things vanish.
@sahaabhishek :clap: @lmangani:matrix.org
I think I'm getting the same, if not very similar issue reported on amark/gun#917 after pulling and running the code from this tutorial https://www.youtube.com/watch?v=J5x3OMXjgMc.
Essentially, if I use a new unique id for the data I'm finding the first entry (or message posted) never shows up, only the following (second, third, etc) messages. Sending a blank first message prior to gun.get("some/room").map().on()
as similar to what is shown by @georgigriffiths in the issue linked above is a workaround.
Specific code in the example is:
I'm experiencing a weird issue with SEA certify. If I provide the pub of 1 user it works fine (the user is able to write to the authority user's graph). If I provide more than 1 pub, then it does not work at all. Is this a bug with certify or am I using it wrong?
This works:
const cert = await SEA.certify(
['H5LBBxrb0wFukxlI9YAFif9M-LVE6JFtRwvMZCTfe54.CzOB4zTpzR3OPa7Ncf6pfOVmyXiAJp3-XohtcBgvwBw'], // 1 pub provided
{"*": "messages", '+': '*' },
user.is.alias,
null
);
This doesn't:
const cert = await SEA.certify(
['H5LBBxrb0wFukxlI9YAFif9M-LVE6JFtRwvMZCTfe54.CzOB4zTpzR3OPa7Ncf6pfOVmyXiAJp3-XohtcBgvwBw', 'eBv261G2jBJOQzAUEb-jn6XISvRQq3rbPgLaatrC9qQ.ZUXChPYESeYFiGizTuppffBETXaBnOTAYjValT1qpsg'], // 2 pubs provided
{"*": "messages", '+': '*' },
user.is.alias,
null
);