Comments (10)
@gustavcorpas this is helpful for helping hunt/track down the bug, thank you. Anyone willing to do a screen call to debug with me?
@amark - I've seen you talk about an "intro to gun internals" a few years? ago. Did this ever happen? I would help, but I find it really difficult to find my way though the code.
This is a good point. I've been a fan of this project for many years. The codebase is difficult to approach though, so I never contributed directly.
from gun.
It seems that using await of any kind will cause this error. Again, only when using gun.user -> normal gun does not care.
Without the await in the following example, gun.user will behave as expected.
Example
for(let i = 0; i < iterations; i++){
await delay(0) // await for zero seconds, will cause issues as the operation is async
const group_pair = crypto.randomUUID();
const user_group = gun_test.get("groups").get(group_pair);
user_group.get("one").put(Date.now());
user_group.get("two").put(Date.now());
user_group.get("three").put(Date.now()); // removing this line will make gun.user() be slightly less bad.
}
from gun.
your above code in the last comment has a problem
const group_pair = crypto.randomUUID();
console.log(typeof group_pair.pub)
from gun.
your above code in the last comment has a problem
const group_pair = crypto.randomUUID(); console.log(typeof group_pair.pub)
You're right. I corrected it. The bigger issue still stands thogh.
from gun.
so.. im not 100% sure, but i think Map/Set are BEST used together and put/on(ce) are BEST used together.. map() use to list out keys ... to map out more data from the graph
https://gun.eco/docs/Frozen#update-immutable-links-to-mutable-user-content
so im asking.. can you check and see if Set and Map fail too?
from gun.
From my understanding map
just maps all the values in a node. set
is just a wrapper for put
, that will give each item a unique key. What I think is odd in this case, is that normal gun maps everything correctly, but gun.user has problems mapping stuff.
Looking at your link, if I understand correctly, the idea is that we put a reference to the user private node a
in the normal public gun. Then use gun.user to put our stuff, but gun to map over the stuff. This is cool! <3
Im not sure that this adresses this issue completely. I will have to try, but doing
gun.get(`~${user._.sea.pub}`).map();
will still not work. I think the issue is with the way that gun.put
works when authenticated.
from gun.
ok cool... there is like small handful of places where this problem could be. because SEA adds in stuff to check/validate user profiles and hashed content. and that code starts here , https://github.com/amark/gun/blob/master/sea.js#L1321
from gun.
Cool, I will take a look at that. In the mean time for anyone else stumbling upon this, what I am doing currently is having all functions that make use of .put be synchronous. If they depend on awaited variables the functions can still await those internally kinda like so:
user.get("root").get("foo").map().once(res => console.log(res)); // will log 100 times
for(let i = 0; i < 100; i++){
put_something(); // function is synchronous
}
function put_something() {
const prepare = (async () => { return {id: (await SEA.pair()).pub } })();
prepare.then(({id}) => { user.get("root").get("foo").get(id).put("hi!") });
}
from gun.
@gustavcorpas this is helpful for helping hunt/track down the bug, thank you. Anyone willing to do a screen call to debug with me?
from gun.
@amark - I've seen you talk about an "intro to gun internals" a few years? ago. Did this ever happen? I would help, but I find it really difficult to find my way though the code.
from gun.
Related Issues (20)
- Why is the source code so bad? HOT 2
- Can not access docs HOT 2
- load() issue HOT 2
- Gun integration with express not working HOT 3
- Once dosen't trigger most of the time, when messages are authenticated to an user. HOT 1
- Gun not working with next.js 14.0.4 HOT 10
- Gun reports all documents always not only changed ones
- Referencing nodes that hold only primitive values HOT 2
- [BUG] Error when importing 'gun/lib/time.js' in nodejs HOT 1
- Use trystero for webrtc (with bittorrent dht signalling) HOT 8
- Setup without build tools HOT 1
- Proposal: GUN URIs to universally reference data HOT 2
- Question: How to split and distribute work? HOT 1
- Question: webseed functionality? HOT 1
- Have AI gen some contributor docs, docstrings, comments HOT 13
- node-webcrypto-oss deprecated HOT 3
- [BUG] gun server / nodejs / ERROR: Radisk needs `store.put` interface with `(file, data, cb)`!
- Problems with Node.js Scripts for Push/Pull Operations HOT 1
- not working even in same computer between to tab HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gun.