owntracks / talk

Questions, talk about OwnTracks
32 stars 4 forks source link

HTTP mode, cards and tids are very limiting #104

Closed fernandonajera closed 3 years ago

fernandonajera commented 3 years ago

My setup is an HTTP endpoint that receives the current position of the guy (via either mobile app) and returns a Json with the location of his friends and cards for them.

As far as I can see, and got it to work, I send a Json array back, each time the app sends me the location, with a number of objects "location" and "card", where they get joined by their tid on the app and shown in the map/contact list.

It works, but two letters are just not enough!

If you happen to have two friends with the same initials (which happens quite often here in Germany!), I am forced to choose unique TIDs which in turn will be shown in the map - confusing the user further since they won't immediately identify their friends.

Also, I have a pool of people which are friends to each other. There are ~1300 possible combinations of 2 characters (if we stick to ASCII), so basically we cannot have any pool bigger than 1300 people if we are to fix TIDs to the person.

I could theoretically still support 1300 friends per person, but that requires that I do "magic" with the TIDs so that they don't clash (basically that remember the TID of each possible pair, so that they look constant from the point of view of each person).

Am I missing something? It would be great to have, for the HTTP mode at least where there is no constant communication, another property than tid that can be longer/unique in the context of the response, and could be used to match the card and the location. Keeping the matching-by-tid as a default if such property didn't exist.

Does this sound doable? Or am I missing something?

Thanks for your great work, btw.

jpmens commented 3 years ago

There are no plans to expand the TID to accomodate more than two characters.

That said,

I could theoretically still support 1300 friends per person

sounds a bit as though you're running this commercially. Is that so?

fernandonajera commented 3 years ago

I understand where your question comes from, but no. I run a small website for a very small group of people (around 100 around the world) who share a common interest - very much like the old times of phpBB, if you like.

I thought it would be fun to let them feel more of a community by adding a map that shows them where each one is. And that’s when I ran into this issue: with just about 20 people wanting to try it out, I had already three clusters of collisions.

The 1300 number was just me going to the extremes: (26 letters + 10 digits)^2

My point is still that, for the HTTP approach, where the cards don’t have a different topic or url, joining them by Tid feels odd. Tid is a two char short way to show to the user who that person is. It is hardly an identifier, in my opinion.

I was not asking to expand the Tid, I realise that would be a breaking change to existing systems. I was asking if you would consider adding an extra “id” field in both location and card that could be used to do the match instead of Tid if such field existed - and resort to the existing match-by-Tid otherwise.

jpmens commented 3 years ago

Related to https://github.com/owntracks/talk/issues/105 if topic is added to payload.