mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix buggy persistence of push timestamps
getPushSubscriptions() could have a stale view of the latest subscription renewal and successful push times. We don't want to rebuild on every renewal or every push, so add a boolean refresh argument that controls rebuilding.
This commit is contained in:
parent
148d743eb1
commit
7b71839615
4 changed files with 13 additions and 6 deletions
|
|
@ -1881,7 +1881,7 @@ func (client *Client) performWrite(additionalDirtyBits uint) {
|
|||
client.server.accounts.saveRealname(account, client.realname)
|
||||
}
|
||||
if (dirtyBits & IncludePushSubscriptions) != 0 {
|
||||
client.server.accounts.savePushSubscriptions(account, client.getPushSubscriptions())
|
||||
client.server.accounts.savePushSubscriptions(account, client.getPushSubscriptions(true))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1968,7 +1968,7 @@ func (client *Client) pushWorker() {
|
|||
for {
|
||||
select {
|
||||
case msg := <-client.pushQueue.queue:
|
||||
for _, sub := range client.getPushSubscriptions() {
|
||||
for _, sub := range client.getPushSubscriptions(false) {
|
||||
if !client.skipPushMessage(msg) {
|
||||
client.sendAndTrackPush(sub.Endpoint, sub.Keys, msg, true)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue