feat: improve group member events and push delivery

This commit is contained in:
richjohnrambo
2026-09-18 01:00:41 +08:00
parent 0e2f4e73d1
commit c6e7f6b923
13 changed files with 521 additions and 19 deletions
+6 -3
View File
@@ -2950,7 +2950,7 @@ func (a *adapter) SubsForTopic(topic string, keepDeleted bool, opts *t.QueryOpt)
// Filter out deleted rows.
q += " AND deletedat IS NULL"
}
limit := a.maxResults
limit := 0
if opts != nil {
// Ignore IfModifiedSince - we must return all entries
// Those unmodified will be stripped of Public & Private.
@@ -2959,13 +2959,16 @@ func (a *adapter) SubsForTopic(topic string, keepDeleted bool, opts *t.QueryOpt)
q += " AND userid=?"
args = append(args, store.DecodeUid(opts.User))
}
limit = a.maxResults
if opts.Limit > 0 && opts.Limit < limit {
limit = opts.Limit
}
}
q += " LIMIT ?"
args = append(args, limit)
if limit > 0 {
q += " LIMIT ?"
args = append(args, limit)
}
ctx, cancel := a.getContext()
if cancel != nil {
+6 -3
View File
@@ -1779,8 +1779,9 @@ func (a *adapter) TenantSubsForTopic(id t.TenantID, topic string, keepDeleted bo
if !keepDeleted {
q += " AND deletedat IS NULL"
}
limit := a.maxResults
limit := 0
if opts != nil {
limit = a.maxResults
if !opts.User.IsZero() {
q += " AND userid=?"
args = append(args, decodeUID(opts.User))
@@ -1789,8 +1790,10 @@ func (a *adapter) TenantSubsForTopic(id t.TenantID, topic string, keepDeleted bo
limit = opts.Limit
}
}
q += " LIMIT ?"
args = append(args, limit)
if limit > 0 {
q += " LIMIT ?"
args = append(args, limit)
}
ctx, cancel := a.getContext()
if cancel != nil {
defer cancel()