mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
Finish inbound E2E device lists (#1243)
* Add tests for device list updates * Add stale_device_lists table and use db before asking remote for device keys * Fetch remote keys if all devices are requested * Add display_name col to store remote device names Few other tweaks to make `Server correctly handles incoming m.device_list_update` pass. * Fix sqlite otk bug * Unbuffered channel to block /send causing sytest to not race anymore * Linting and fix bug whereby we didn't send updated dl tokens to the client causing a tightloop on /sync sometimes * No longer assert staleness as Update blocks on workers now * Back out tweaks * Bugfixes
This commit is contained in:
parent
30c2325eaf
commit
f371783da7
15 changed files with 639 additions and 48 deletions
|
@ -112,6 +112,9 @@ type StreamingToken struct {
|
|||
}
|
||||
|
||||
func (t *StreamingToken) SetLog(name string, lp *LogPosition) {
|
||||
if t.logs == nil {
|
||||
t.logs = make(map[string]*LogPosition)
|
||||
}
|
||||
t.logs[name] = lp
|
||||
}
|
||||
|
||||
|
@ -173,12 +176,14 @@ func (t *StreamingToken) WithUpdates(other StreamingToken) (ret StreamingToken)
|
|||
}
|
||||
ret.Positions[i] = other.Positions[i]
|
||||
}
|
||||
ret.logs = make(map[string]*LogPosition)
|
||||
for name := range t.logs {
|
||||
otherLog := other.Log(name)
|
||||
if otherLog == nil {
|
||||
continue
|
||||
}
|
||||
t.logs[name] = otherLog
|
||||
copy := *otherLog
|
||||
ret.logs[name] = ©
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue