Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing New Prekeys #488

Closed
seanieb opened this issue Sep 7, 2022 · 1 comment
Closed

Publishing New Prekeys #488

seanieb opened this issue Sep 7, 2022 · 1 comment

Comments

@seanieb
Copy link

seanieb commented Sep 7, 2022

What are the current best practices around uploading new Prekeys? Should the client poll the server to check if their pre-keys are nearly exhausted, once a day/hourly, on app startup or after a certain number of sessions? Or should the client wait for a server notification that they need to publish.

This was discussed here with respect to libsignal but no solution is mentioned:
signalapp/Signal-Desktop#221

Thanks!

@jrose-signal
Copy link
Contributor

jrose-signal commented Sep 23, 2022

I know the iOS codebase best; here's what it does:

https://github.com/signalapp/Signal-iOS/blob/6ecb00288611f77c39f4f6edb307c986e3709d09/SignalServiceKit/src/Account/TSPreKeyManager.m#L143-L144

That is essentially "check every 12 hours" (the "shouldThrottle" flag is only used for debugging)…

https://github.com/signalapp/Signal-iOS/blob/6ecb00288611f77c39f4f6edb307c986e3709d09/SignalServiceKit/src/Account/RefreshPreKeysOperation.swift#L44-L48

…and "upload when the keys are 2/3 exhausted". There are a number of places that check gets called, not just app startup, in case the app stays resident in memory a long time, but the Signal chat server doesn't today send anything to the client to say you've run out of one-time pre-keys. It certainly could, however.

[edit: hm, not sure why those code snippet permalinks aren't rendering inline]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants