Closed jaylevin closed 6 years ago
I cannot reproduce. I just tested it on the public server at api.tinode.co and it worked as expected:
[19:14:39:899] out: {"set":{"id":"113377","topic":"fnd","desc":{"public":"a@example.com"}}}
tinode.js:895 [19:14:40:068] in: {"ctrl":{"id":"113377","topic":"fnd","code":200,"text":"ok","ts":"2018-06-25T19:14:39.990Z"}}
tinode.js:895 [19:14:40:073] out: {"get":{"id":"113378","topic":"fnd","what":"sub"}}
tinode.js:895 [19:14:40:260] in: {"meta":{"id":"113378","topic":"fnd","ts":"2018-06-25T19:14:40.169Z","sub":[{"updated":"2018-06-25T19:14:12.263Z","acs":{"mode":0},"public":{"fn":"Alice Johnson","photo":{"data":"<9760, bytes: /9j/4AAQSkZJ...kPDXadVL/9k=>","type":"jpg"}},"private":["a@example.com"],"user":"usrnHOIUmeyZEg"}]}}
You can try it yourself. I've added a tag a@example.com to Alice. You can login as another user, for instance as Bob, then search for a@example.com.
Can you show how to reproduce the issue with api.tinode.co?
topic[fndxQy56wpOmGk] meta.Set.Desc failed: {set} generated no update to DB
That's likely not an error. It means that you are not modifying the field. It must have held the same value before.
field of the user's fnd topic to the tag being searched for violates the condition that the public field is a vCard
It's supposed to be that way for fnd
.
I am unable to reproduce on api.tinode.co, but still am confused to where I'm going wrong... Whatever is triggering that error seems to be my problem though.
What I don't get is the docs explicitly say that the public
field of the fnd
topic is ephemeral, which means performing a {set}
will not modify anything in the DB... hence this error seems like expected behavior to me:
topic[fndxQy56wpOmGk] meta.Set.Desc failed: {set} generated no update to DB
.
What confuses me is that that error is not present in your reproduction above. Why is this?
I would suggest to verify basics: make sure the other user actually has person@example.com
set, and not, for instance email:person@examle.com
or preson@exmaple.com
. Make sure fnd
works for existing tags. See if you can reproduce the bug using your server and stock web client.
Is it possible that you are using an older server with the newer client or vice versa?
Could you please start a new server instance, execute the steps which lead to the error and show the entire server log.
OK, I can reproduce the issue now. It's grpc-specific. Looking into it.
So, it's not exactly a bug but a side effect of using protocol buffers.
Protobufs don't support generic objects. One can't create an object (or a dictionary or a map) and have protobuf correctly serialize/deserialize it if the object is not defined in advance in a .proto file. But Tinode uses such generic objects in a few places. To pass a generic object through protobuf it's first converted into json then sent as an array of bytes. When you set public
to person@examle.com
you set it as a literal string person@examle.com
which is not valid json and consequently server fails to parse it. There was no reporting of such errors on the server. I added it now. Send it as a quoted string "person@examle.com"
. Then it will be parsed correctly. Likewise, when you receive a generic object from server you must deserialize it from json.
I've added appropriate conversion to tn-cli
(see large-files
branch).
Works like a charm. Thank you very much!
Hello, I have a small clarification question regarding https://github.com/tinode/chat/blob/master/docs/API.md#fnd-and-tags-finding-users-and-topics.
Here is what I am doing:
fnd
topic, does a {set topic="fnd"} on public field toperson@example.com
. There is another user in database withtags:[person@example.com]
I noticed that by setting the
public
field of the user'sfnd
topic to the tag being searched for violates the condition that thepublic
field is a vCard? Currently I am just setting the entire public field to the tag being searched for, noemail:
prefix... Is this where I go wrong?Here is my server log.. Obviously something is failing with my
{set}
, no clue what it could beThank you for your help