at_server icon indicating copy to clipboard operation
at_server copied to clipboard

feat: atKeys sorting (scan verb)

Open realvarx opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Having a concise way of knowing how the atKeys retrieved via scan verb are sorted.

Describe the solution you'd like

Check if atKeys retreived by scan verb are currently being sorted in some way (looks like natural order), and decide if current sorting algorithm can continue to be used (defining exactly how it is working), or if it should be changed by any other (provided that this is posible).

Additional context (Why can this be important?)

If we take the example of building an application (with a large number of atKeys) on which we frequently need to update/delete atKeys of an atSign, we really want to avoid doing frequent calls to retrieve all the keys. One solution for that situation, is to do as less calls as posible, and handle a list locally (after a first sync).

We could add new keys at the tail of the queue, or move one step forward all the atKeys that were after one which was deleted. The user would see the new keys at the end of the list, and would not see the ones which were deleted. The problem is that next time that we sync via scan verb, the order of the keys will be different (as the real storage and sorting in the server are not just adding them at the end, they follow an algorithm). So if the user reloads the app for any reason, or a scan verb sync happens, the order will change. This would not matter at all in many situations, but could be annoying in others (on which we are taking order in account).

realvarx avatar Jul 20 '22 10:07 realvarx

This is a copy of the keys on my atSign. I feel that they are already sorted well. What do you think @realvarx ? Not sure if I am understanding what you are saying.

0 : "@abbcservicesinc:shared_key@smoothalligator" 1 : "@denise:shared_key@smoothalligator" 2 : "@er_nobile_14:shared_key@smoothalligator" 3 : "@fascinatingsnow:shared_key@smoothalligator" 4 : "@hacktheleague:shared_key@smoothalligator" 5 : "@smoothalligator:signing_privatekey@smoothalligator" 6 : "@wildgreen:shared_key@smoothalligator" 7 : "atconnections.abbcservicesinc.smoothalligator.at_contact.mospherepro@smoothalligator" 8 : "atconnections.denise.smoothalligator.at_contact.mospherepro@smoothalligator" 9 : "atconnections.hacktheleague.smoothalligator.at_contact.mospherepro@smoothalligator" 10 : "atconnections.wildgreen.smoothalligator.at_contact.mospherepro@smoothalligator" 11 : "cached:@smoothalligator:shared_key@abbcservicesinc" 12 : "cached:@smoothalligator:shared_key@denise" 13 : "cached:@smoothalligator:shared_key@fascinatingsnow" 14 : "cached:@smoothalligator:shared_key@wildgreen" 15 : "cached:public:firstname.wavi@abbcservicesinc" 16 : "cached:public:firstname.wavi@wildgreen" 17 : "cached:public:image.wavi@abbcservicesinc" 18 : "cached:public:image.wavi@denise" 19 : "cached:public:image.wavi@wildgreen" 20 : "cached:public:lastname.wavi@abbcservicesinc" 21 : "cached:public:lastname.wavi@wildgreen" 22 : "cached:public:publickey@abbcservicesinc" 23 : "cached:public:publickey@denise" 24 : "cached:public:publickey@er_nobile_14" 25 : "cached:public:publickey@fascinatingsnow" 26 : "cached:public:publickey@hacktheleague" 27 : "cached:public:publickey@wildgreen" 28 : "public:email.wavi@smoothalligator" 29 : "public:field_order_of_self.wavi@smoothalligator" 30 : "public:firstname.wavi@smoothalligator" 31 : "public:following_by_self.at_follows.wavi@smoothalligator" 32 : "public:lastname.wavi@smoothalligator" 33 : "public:privateaccount.wavi@smoothalligator" 34 : "public:publickey@smoothalligator" 35 : "public:signing_publickey@smoothalligator" 36 : "public:theme_color.wavi@smoothalligator" 37 : "publickey.fascinatingsnow@smoothalligator" 38 : "senthistory_v2.mospherepro@smoothalligator" 39 : "shared_key.abbcservicesinc@smoothalligator" 40 : "shared_key.denise@smoothalligator" 41 : "shared_key.er_nobile_14@smoothalligator" 42 : "shared_key.fascinatingsnow@smoothalligator" 43 : "shared_key.hacktheleague@smoothalligator" 44 : "shared_key.wildgreen@smoothalligator"

JeremyTubongbanua avatar Jul 24 '22 01:07 JeremyTubongbanua

@JeremyTubongbanua The issue is not that the current sort order is no good, but that we don't currently guarantee any particular sort order.

gkc avatar Jul 25 '22 13:07 gkc