Why not just disable priority?
Can't do it on the tracker. We need a means of ensuring certain events force the tracker to send a record immediately, and the only way to do that on teltonika is to mark the setting as "High Priority". For example, we need it to immediately send record if ignition state changes, or when the movement flag goes to 0.
There's no setting on Teltonika for "connect immediately, but don't treat it as high priority". One and both are the same.
Does Teltonika have any flag to say when history finished uploading?
That's an excellent question, and one I'll go dig into. Bear with me while I do that.
OK, checked and confirmed via Teltonika Wiki on their Data Sending Protocols that no, there is no flag for this.
https://wiki.teltonika-gps.com/view/Teltonika_Data_Sending_Protocols
We also have a support ticket from Teltonika directly where they confirmed the above.
Do you already have your solution implemented?
Not yet, it's 500 lines of code and we've made an insane amount of changes to our fork of the codebase recently. Almost too many in the space of time we've made them.
Because the change is so large and could really bork records if it misbehaves, we're tabling it for the moment. As stated, the issue only occurs when devices are offline and generate a mix of high and low priority records. For nearly all of our customers, it's extremely rare. But, we're in Australia and we have customers in the mines etc, where there is zero coverage.
BTW Teltonika are working on firmware to support Starlink Direct-to-Cell so the problem might solve itself.
Context first: We have code we can submit as a PR here to resolve the issue below.
Teltonika trackers can be configured to send records with High Priority. Must customers (including us) use this feature to force the tracker to send records outside of the normal reporting interval, or to wake a tracker from sleep (and also send a record). However, if a teltonika tracker has no mobile signal, it will store all of its records in a local cache (100MB, basically 12 months+ worth). When a mobile signal is re-obtained, the tracker will upload all high priority records first, and then all normal/low priority records.
The following Claude-generated diagram visualises the issue.

Before we submit a PR, is this even considered a problem? If not, we will apply it to our systems only.
Here's a summary of what the PR does: