Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mobile won't use this because long polling is likely bad for battery life, and we can't do constant long polling in the background anyway.
dnapitest is a helper package for packages which import dnapi. This PR adds code with the assumption that the client information should always be filled out by clients calling LongPollWait - this will be true of dnclient, at least.
However, on that bit... ClientInfo contains all the same info as the useragent, but in a more structured format. One downside to this approach when compared to the useragent approach is that both the outer and inner structs must be decoded to get to these fields. We currently have middleware on the dnclient endpoint that looks at the useragent and saves some analytics to Prometheus. This ClientInfo is not as useful for that purpose.
We also call
updateStaleMetadata
as part ofpostDNClient
- again, this happens before LongPollWait message is decoded, so this information is not useful in that context. Although, we could refactor things so thatupdateStaleMetadata
is only called from LongPollWait and CheckForUpdate (for mobile.)Or we could drop this entire thing and continue using the useragent. Or move it into the unsigned dnclient message struct. Thoughts?