Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
46ecd9fd
Commit
46ecd9fd
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Use stream_ordering_to_exterm for /keys/changes
parent
5ae38b65
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/device.py
+9
-9
9 additions, 9 deletions
synapse/handlers/device.py
with
9 additions
and
9 deletions
synapse/handlers/device.py
+
9
−
9
View file @
46ecd9fd
...
@@ -17,7 +17,7 @@ from synapse.api import errors
...
@@ -17,7 +17,7 @@ from synapse.api import errors
from
synapse.api.constants
import
EventTypes
from
synapse.api.constants
import
EventTypes
from
synapse.util
import
stringutils
from
synapse.util
import
stringutils
from
synapse.util.async
import
Linearizer
from
synapse.util.async
import
Linearizer
from
synapse.types
import
get_domain_from_id
from
synapse.types
import
get_domain_from_id
,
RoomStreamToken
from
twisted.internet
import
defer
from
twisted.internet
import
defer
from
._base
import
BaseHandler
from
._base
import
BaseHandler
...
@@ -243,15 +243,15 @@ class DeviceHandler(BaseHandler):
...
@@ -243,15 +243,15 @@ class DeviceHandler(BaseHandler):
possibly_changed
=
set
(
changed
)
possibly_changed
=
set
(
changed
)
for
room_id
in
rooms_changed
:
for
room_id
in
rooms_changed
:
# Fetch (an approximation) of the current state at the time.
# Fetch the current state at the time.
event_rows
,
token
=
yield
self
.
store
.
get_recent_event_ids_for_room
(
stream_ordering
=
RoomStreamToken
.
parse_stream_token
(
from_token
.
room_key
)
room_id
,
end_token
=
from_token
.
room_key
,
limit
=
1
,
)
if
event_rows
:
try
:
last_event_id
=
event_rows
[
-
1
][
"
event_id
"
]
event_ids
=
yield
self
.
store
.
get_forward_extremeties_for_room
(
prev_state_ids
=
yield
self
.
store
.
get_state_ids_for_event
(
last_event_id
)
room_id
,
stream_ordering
=
stream_ordering
else
:
)
prev_state_ids
=
yield
self
.
store
.
get_state_ids_for_events
(
event_ids
)
except
:
prev_state_ids
=
{}
prev_state_ids
=
{}
current_state_ids
=
yield
self
.
state
.
get_current_state_ids
(
room_id
)
current_state_ids
=
yield
self
.
state
.
get_current_state_ids
(
room_id
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment