What I did:
All my group topics (name starting with grp) have a public JSON field like:
{"fn": "test", "description": "fff", "alias": "public"}
The special topic fnd exists in my topics table with access set to {"Auth":"RWP","Anon":"N"}.
All group topics have access set to {"Auth":"RJWP","Anon":"N"}.
My search sequence in wscat:
{"hi":{"ver":"0.24","ua":"wscat"}}
{"id":"login1","login":{"scheme":"token","secret":"..."}}
{"id":"subfnd1","sub":{"topic":"fnd"}}
{"id":"setfnd1","set":{"topic":"fnd","desc":{"public":"alias:public"}}}
{"id":"getfnd1","get":{"topic":"fnd","what":"sub"}}
1 vulnerability
What happens:
The set command returns {"code":200,"text":"ok"}.
The get command returns {"code":500,"text":"internal error"}.
On the server logs, I see:
topic[fndwOv0vFiVbwk] meta.Get.Sub failed: ERROR: syntax error at or near "COUNT" (SQLSTATE 42601)
What I expect:
I should receive a meta.sub response with the list of all public group topics having "alias": "public" in their public field.
What I tried:
I verified all access rights and the structure of the public field.
I tried with different filters (desc.public: "", desc.public: "test", etc).
I tried with and without tags.
I restarted the server after every change.
Question:
Is this a known bug in Tinode (laster, PostgreSQL)?
Is there a workaround or a patch for this SQL error?
What is the correct way to structure the public field and the search filter for reliable public group discovery?
In fact, I want to display the entire list of topics.