deepstreamIO / deepstream.io

deepstream.io server
https://deepstreamio.github.io
MIT License
7.13k stars 382 forks source link

Feature: Get a list of all available records/events/rpcs #1101

Closed redlock closed 3 years ago

redlock commented 3 years ago

Hello, A much needed use case that I often face is to query the server for a list of available records (or other objects). Currently I can't find a way to do it. It helps a lot for debugging while in development; to see if a record was created and why some record is missing (record name misspelled, etc). Some metadata that can come along with the query, such as when the record was created and when it was last updated and the size of the record.

Thanks

slachtar commented 3 years ago

Hello, IMHO record creation timestamp and any other information can be added/updated by the client maniplulating the record. Later you can retrieve this information.

As for checking if a record was created or not, the snapshot method will return null if record does not exist.

Regards,

On Wed, Mar 24, 2021, 08:37 Fahad A. Al Khaled @.***> wrote:

Hello, A much needed use case that I often face is to query the server for a list of available records (or other objects). Currently I can't find a way to do it. It helps a lot for debugging while in development; to see if a record was created and why some record is missing (record name misspelled, etc). Some metadata that can come along with the query, such as when the record was created and when it was last updated and the size of the record.

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/deepstreamIO/deepstream.io/issues/1101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKH2Q54ZGKAX55KXCS5NLTFGJCXANCNFSM4ZWWLFKA .

redlock commented 3 years ago

Hi, Right now my clients connect to a metadata server to get a list of records that they can subscribe to. This metadata server won't be needed if I can simply query Deepstream for all available records. Also, sometimes you can't find a record and the reason is because there was a typo or the record name is different in some minor way. Having a list of available records you can quickly see where the fault lies.

Another use case is while in development you want to test whether you can subscribe to a record in your dev Deepstream instance, but you aren't sure what records are available (because it is a dev server use for testing). Every time I face this scenario I have to either guess the records name from memory or start some other client to create a new record.

Implementation wise it does seem like an easy feature to add.

slachtar commented 3 years ago

I see better your use case now, thank you.

My idea is to avoid any over head server side to keep it as light as possible, that's why I suggested to do things client side.

May be it could be added as server feature that can be activated/deactivated in config file.

On Wed, Mar 24, 2021, 09:08 Fahad A. Al Khaled @.***> wrote:

Hi, Right now my clients connect to a metadata server to get a list of records that they can subscribe to. This metadata server won't be needed if I can simply query Deepstream for all available records. Also, sometimes you can't find a record and the reason is because there was a typo or the record name is different in some minor way. Having a list of available records you can quickly see where the fault lies.

Another use case is while in development you want to test whether you can subscribe to a record in your dev Deepstream instance, but you aren't sure what records are available (because it is a dev server use for testing). Every time I face this scenario I have to either guess the records name from memory or start some other client to create a new record.

Implementation wise it does seem like an easy feature to add.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/deepstreamIO/deepstream.io/issues/1101#issuecomment-805593981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATKH2TGV6QHK75N6QDTUB3TFGMWVANCNFSM4ZWWLFKA .

yasserf commented 3 years ago

So the server already contains all of this logic inside of the state registries, the easiest thing to do would be to add a HTTP request that just dumps it out if the correct auth token is there. That way you don't need to add anything to clients or realtime protocols.

redlock commented 3 years ago

Another use case is that this allows for creating an admin console for a Deepstream server. Someone can build something similar to Firebase admin console, where you can inspect, browse and update data in a nifty web ui.

jaime-ez commented 3 years ago

Hi, if someone want's to implement this please make a pull request following yasser suggestion. Thanks!