Resgate Docs state that notifications are not supported?

in the JSONRPC section of the resgate docs, it says that notifications are not supported, however, when I tried sending them I didn’t get any response from the server as expected for a notification.

I’m still not entirely sure if this is correct or if I have something wrong with my code. I’ve spent about an hour checking that I have no bugs but I’m still not sure.

~ Ico the folf ^w^

What sort of JSON do you try to send?

What is meant with “Notifications are not supported”, is that the client cannot send any request to the server without an id property.

If you send a message from the client to Resgate without id, Resgate will simply discard it.

1 Like

ah okay, that makes more sense, thanks ^w^

sorry, another silly question >w<

  "event": "myService.myModel.change",
  "data": {
    "myProperty": "New value",
    "unusedProperty": { "action": "delete" }
  }
}

would the above event set unusedProperty to { “action”: “delete” }
or remove/delete it from the cache?

as seen here

~Ico the folf ^w^

Not a silly question at all!

If you have a model, myService.myModel, that looks like this:

{
   "untouchedProperty": "foo",
   "myProperty": "bar",
   "unusedProperty": "baz"
}

… and then you get the above change event - then the model in the client cache should be updated to look like this:

{
   "untouchedProperty": "foo",
   "myProperty": "New value"
}

So, you are not to delete the model itself. But the property, unusedProperty, is to be removed from the model.

EDIT: The change event doesn’t necessarily contain all properties; only the properties that has changed.

Thank you, makes a lot more sense now. I think I’ve nearly finished the main part of the ResClient (finally).

1 Like

Sorry, another message >w<

I notice that the specification lists the following as built in events: add, change, create, delete, patch, reset, reaccess, remove or unsubscribe.

It describes how to use add, change, remove and unsubscribe.
But what do the others do specifically?

I understand what reset or delete may do, but what are all of their specific… Protocols? (I can’t think of the proper word for the life of me >w<)

Also, I have only found 1 custom event from mucklet so far being out. Are there any others?

It is true that the only events that Resgate currently emits to clients are:

  • add, remove for Collections
  • change for Models
  • unsubscribe for any type of resource (Model/Collection)

The other events are reserved because they are used in the RES Service protocol, in the communication between services and Resgate, and has a purpose there. This means, Resgate will handle those events, but not propagate them further to the client.

The only event that is reserved, but not yet defined, is patch.
And true; out is the only custom event we use for the mucklet server.

Btw: Okay if I move this conversation to the #development category? I think others might find value in it too.

Ah, okies. Thank you acci, I guess I’ll add in some void support for them, also I think moving the conversation to #development would be a good idea, I should probably post there instead from now on rather then DMing you >w< sowwy.