I'm trying to add an ability to my API client that tries to emulate numbers by creating and maintaining an index of "number to ID" mappings.
I've read that IDs don't change within a single session even after CRUD operations, which I guess is good news for performance, but... how is the initial number list generated?
I thought that the IDs are sorted (in ascending order) and that's the starting point... but apparently, not so - not only do my PHP tests produce misleading results with that assumption, but on closer inspection, the IDs aren't even sorted in terminal (e.g. my first two simple queues have IDs "*4d5" and "*4d6", while a queue MUCH later on in the list has an ID "*102"; all that after logging out and in from Winbox, so IDs are sure to be fresh).
So how does the number list get generated at all if not by ID sorting? Whatever order "print" responses arrive in? I thought those are supposed to not be significant... right? Or is that only in the API protocol, while there's significance in terminal?
Note: I think I might have a workaround involving creating a script that processes this, and then finally retrieve the results, but this is very performance costly (not to mention that it means users will be required to have writing privileges, even if they're just reading), and so I ask in hopes to avoid it.
EDIT: Actually, rereading the API spec now, it's the order of properties that shouldn't be relied upon. Should I take this to mean that I can rely on the order of "print" reply sentences to match the numbers? This certainly appears to work on my RouterOS version (5.6), but the question is if that's intended, or just a coincidence.