Skip to content

Add LongPollWait command#8

Merged
johnmaguire merged 2 commits intomainfrom
longpollwait
May 15, 2024
Merged

Add LongPollWait command#8
johnmaguire merged 2 commits intomainfrom
longpollwait

Conversation

@johnmaguire
Copy link
Copy Markdown
Member

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 of postDNClient - again, this happens before LongPollWait message is decoded, so this information is not useful in that context. Although, we could refactor things so that updateStaleMetadata 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?

@johnmaguire johnmaguire requested a review from brad-defined May 10, 2024 20:15
@johnmaguire johnmaguire merged commit 5dd626b into main May 15, 2024
@johnmaguire johnmaguire deleted the longpollwait branch May 15, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants