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
23125251
Unverified
Commit
23125251
authored
4 years ago
by
Patrick Cloke
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix "argument of type 'ObservableDeferred' is not iterable" error (#7708)
parent
5c5516f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/7708.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/7708.bugfix
synapse/storage/data_stores/main/receipts.py
+5
-4
5 additions, 4 deletions
synapse/storage/data_stores/main/receipts.py
synapse/util/async_helpers.py
+1
-1
1 addition, 1 deletion
synapse/util/async_helpers.py
with
7 additions
and
5 deletions
changelog.d/7708.bugfix
0 → 100644
+
1
−
0
View file @
23125251
Fixs a long standing bug which resulted in an exception: "TypeError: argument of type 'ObservableDeferred' is not iterable".
This diff is collapsed.
Click to expand it.
synapse/storage/data_stores/main/receipts.py
+
5
−
4
View file @
23125251
...
...
@@ -24,6 +24,7 @@ from twisted.internet import defer
from
synapse.storage._base
import
SQLBaseStore
,
make_in_list_sql_clause
from
synapse.storage.database
import
Database
from
synapse.storage.util.id_generators
import
StreamIdGenerator
from
synapse.util.async_helpers
import
ObservableDeferred
from
synapse.util.caches.descriptors
import
cached
,
cachedInlineCallbacks
,
cachedList
from
synapse.util.caches.stream_change_cache
import
StreamChangeCache
...
...
@@ -300,10 +301,10 @@ class ReceiptsWorkerStore(SQLBaseStore):
room_id
,
None
,
update_metrics
=
False
)
# first handle the Deferred case
if
isinstance
(
res
,
defer
.
Deferred
):
if
res
.
called
:
res
=
res
.
result
# first handle the
Observable
Deferred case
if
isinstance
(
res
,
Observable
Deferred
):
if
res
.
has_
called
()
:
res
=
res
.
get_
result
()
else
:
res
=
None
...
...
This diff is collapsed.
Click to expand it.
synapse/util/async_helpers.py
+
1
−
1
View file @
23125251
...
...
@@ -93,7 +93,7 @@ class ObservableDeferred(object):
This returns a brand new deferred that is resolved when the underlying
deferred is resolved. Interacting with the returned deferred does not
effect the under
d
lying deferred.
effect the underlying deferred.
"""
if
not
self
.
_result
:
d
=
defer
.
Deferred
()
...
...
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