Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:52
    noctisatrae commented #1258
  • 21:06
    noctisatrae commented #1258
  • 21:04
    noctisatrae commented #1258
  • 21:03
    noctisatrae commented #1258
  • 02:00
    bmatusiak commented #1258
  • Jun 26 22:29
    noctisatrae reopened #1258
  • Jun 26 22:29
    noctisatrae commented #1258
  • Jun 26 21:43
    amark commented #1258
  • Jun 26 21:42
    amark commented #1258
  • Jun 26 21:35
    noctisatrae closed #1258
  • Jun 26 21:35
    noctisatrae commented #1258
  • Jun 26 14:15
    draeder updated the wiki
  • Jun 26 14:14
    draeder updated the wiki
  • Jun 26 11:02

    amark on master

    Thanks @gabriellemon Gabriel fo… (compare)

  • Jun 25 23:26
    d3x0r commented #404
  • Jun 25 19:47
    noctisatrae commented #1258
  • Jun 25 19:46
    noctisatrae commented #1258
  • Jun 25 19:42
    noctisatrae commented #1258
  • Jun 25 19:11
    noctisatrae commented #1258
  • Jun 25 14:45
    bmatusiak commented #1258
Jachen Duschletta
@Dletta
[D]bmatusiak: like signing/verifying with ACL
[D]bmatusiak: i also need to build in indexing for gunfs
Jachen Duschletta
@Dletta
[D]anoxy: <@139291366869041153> you are doing an amazing job, I hope that you can gather together all links which we can see in the GUNDB Svelte documents
Jachen Duschletta
@Dletta
[D]anoxy: A question, lets say that I put data in a node with:
        1. `someData1 = {name: 'Title', tag: 'my tag'}`
        2. `user.get('notes').get('category').get(nodeKey).put(someData1)`

        then I delete that data with:
        3. `user.get('notes').get('category').get(nodeKey).put(null)`

        the `nodeKey` will still be there, but if I choose to delete the `nodeKey` itself by using
        4. `user.get('notes').get('category').put(null)`

        is all the data belonging to that nodeKey also delete? 
        Lets assume that I delete the `nodeKey`, and later on I add some data to the same nodeKey:

        5. `someData2 = {describe: 'Some description', where: 'here :) '}`
        6. `user.get('notes').get('category').get(nodeKey).put(someData2)`

        will anything from the old data (`someData1`) be shown after step `6` ?
        In other words will the `name` and `tag` words still be there even though I deleted it according to step `3`?
Jachen Duschletta
@Dletta
[D]bmatusiak: <@!366349503265112074> user.get('notes').get('category').put(null) will delete other nodekeys
[D]Dletta: but all the children are preserved at root
[D]Dletta: so you could re-reference them later
[D]Dletta: <@!366349503265112074>
[D]bmatusiak: ^^
[D]vegardkrogh: How about this?
// add object with multiple keys
user.get("notes").get(key).put({ name, tag })

// delete single key/value from object

let document;
user.get("notes").get(key).once(data => (document = data))
delete document["tags"]

user.get("notes").get(key).put(null).put(document)
[D]Dletta: So let's say you do 4. before 3 then you can go back to someData1 and it will still be here
[D]anoxy: <@!280426612900757504> yes I am aware of that, but the nodeKeys are still there and probably withs data as well preserved at root, so whener I add a nodeKey back its content will be back or am I wrong <@!612728945313316904> ?
[D]vegardkrogh: <@!366349503265112074> thank you! I'll try to update the documents with as many sensible approaches as I can find. But I really think that https://github.com/irislib/iris-lib is a great example of proper usage of GUN in a library, but it's hard to make an approach like this fit the format of documentation examples
Jachen Duschletta
@Dletta
[D]anoxy: <@!139291366869041153> thanks I will test your coding.
indeed iris-lib is good, but I think we need more simple demos for making people to get used to both GUN and Svelte 🙂
Jachen Duschletta
@Dletta
[D]anoxy: Ok guys, I have issues now with deleting a node and later on adding some data to it.
https://jsbin.com/rorezebaho/edit?html,js,console,output

[D]anoxy: basically I add data to a node with:
user.get('notes').get('category').get(Gun.time.is()).put(objectData);

and I delete all the data with:
user.get('notes').get('category').put(null);

this works without any problems.... BUT I cannot add more data to that node again after setting it to null

so if I do this again:
user.get('notes').get('category').get(Gun.time.is()).put(objectData);

the data isnt added at all even though I cannot see the result of the object in the Console

[D]anoxy: please check the link above and tell me what I am doing wrong
[D]anoxy: note that I can delete nodeKeys without any problems, but this user.get('notes').get('category').put(null); doesnt work
Jachen Duschletta
@Dletta
[D]anoxy: Is this perhaps a bug?
pszabop
@pszabop
@amark in the bug I filed regarding the internal timeout errors (warnings?) I was able to reproduce it with just callbacks. Add a delay of about 10-20 seconds to the end of a test, they'll show up.
Jachen Duschletta
@Dletta
I sent you a DM
pszabop
@pszabop
@amark I'm starting to use ETL / scatter gather and once I get used to the idiosyncrasies of the Gun API it seems to work fine so far. In fact I'm writing a lightweight wrapper to hide the idiosyncrasies and I'd be happy to share when I've got something more substantial
Jachen Duschletta
@Dletta
[D]bmatusiak: <@!366349503265112074> i was able to re init the scope like
    user.get('notes').get('category').put({init:Gun.time.is()})
  });
[D]bmatusiak: so to you can do this to add them instead
var $gk = {};
  $gk[Gun.time.is()] = objectData;
    user.get('notes').get('category').put($gk)
Jachen Duschletta
@Dletta
[D]Dletta: <@366349503265112074> if you had other data on your key it will be back
[D]Dletta: But if you null them all out, then it will just show nulls
Jachen Duschletta
@Dletta

[D]anoxy: <@280426612900757504> by re-init do you mean: get back the node data ?

<@612728945313316904> so in other words, if I put null on a node for ie in my case if I do null on category by get('category') then only the node itself gets nulled, any other data or keyNodes which belongs to that node will still be present in the root right ?

[D]anoxy: How can I null out all data and nodeKeys which belongs to a nodem
[D]anoxy: <@280426612900757504> but why cannot I only use the regular method by using put(someData) in a node which has been nulled ?
[D]anoxy: I think this is an odd behavior, I should at least be able to use the regular put(someData) in a
nulled node.
Jachen Duschletta
@Dletta

[D]anoxy: @anoxy if you had other data on your key it will be back

<@612728945313316904> you wrote like this, can you please provide an example of this after using null on the node ?

[D]Dletta: So category only contains a reference to a sub node, so putting null there only removes the reference to the subnode, but subnode isn’t deleted. To delete a subnode you start at the lowest node you want delete and slowly work up nulling each property
Jachen Duschletta
@Dletta

[D]anoxy: How is that done in a smooth way ?
And yeah null only deletes the references I got that part, but why cannot I add new references to the nulled node ? This can be seen here
https://jsbin.com/rorezebaho/edit?html,js,console,output

Create a user and login, add some categories, and then delete the node. And try to add new categories. It just doesn't work. <@280426612900757504> sent some code to make it works but I think it should still be possible to give new references to a nulled node with put

[D]bmatusiak: i see, setting it as null i think stops it from adding props/more paths/nodes so setting a object with some data re-enables paths, so it a possible bug
[D]bmatusiak: like in js if you have var testing = null and do testing.something = "hello" it fails
Jachen Duschletta
@Dletta
[D]bmatusiak: but gun does reference it to root
[D]Dletta: testing = {}
[D]Dletta: You should first turn it back into an object , no?
[D]bmatusiak: yea exactly
[D]bmatusiak: thats what im thinking
[D]Dletta: Because null is not an object
[D]Dletta: <@366349503265112074> put {}
[D]Dletta: See if that works
[D]bmatusiak: yea he tried
[D]bmatusiak: <@!366349503265112074> https://pastebin.com/MDtwdHt5 this is what i have @ line 49
Jachen Duschletta
@Dletta
[D]bmatusiak: does anybody where use requirejs?
Jachen Duschletta
@Dletta
[D]anoxy: <@612728945313316904> I am mobile now but yeah it seems that put({}) works , didn't know that null in GUN acted exactly as in JS . Thanks .
Jachen Duschletta
@Dletta

[D]anoxy: <@280426612900757504> thanks for giving me a solution as well.

But now to my question if I want to delete all data and keys belonging to a node .
In my case it is :
user.get('notes').get('category')
Where it's "data" has the structure:

{Gun.time.is(): 
 {name: 'some text', prop2: 'some other text'},
Gun.time.is(): 
 {name: 'some text', prop2: 'some other text'}
}
Jachen Duschletta
@Dletta

[D]keymaker91: <@!178314946201780224> Thank you for the elaborate response. I understand your thought process, your ideas and the way you are pushing gun forward. Kudos to you for building such an amazing community and having such wonderful rhetorics.

GitHub counts comments/feedback as contributions. For the sake of great ideas behind gun, I hope you are counting them as well.

I have nothing else to contribute

Jachen Duschletta
@Dletta
[D]bmatusiak: <@!366349503265112074> <@!612728945313316904> amark/gun#865 its a start to use requirejs