Opened 11 years ago

Closed 8 years ago

#1609 closed defect (fixed)

sugar.datastore.datastore.find(): async mode broken

Reported by: sascha_silbe Owned by: erikos
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Sugar Version: Git as of bugdate
Severity: Blocker Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: New

Description

sugar.datastore.datastore.find() leads the API consumer into believing it supports asynchronous operation by offering the reply_handler and error_handler parameters, but it breaks if those are used:

>>> sugar.datastore.datastore.find({'foo': 'bar'}, reply_handler=cb, error_handler=cb)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sascha.silbe/sugar-jhbuild/install/lib/python2.5/site-packages/sugar/datastore/datastore.py", line 277, in find
    reply_handler, error_handler)
TypeError: 'NoneType' object is not iterable
>>> 

This has been fixed during my data store access refactorings (#1197), but since those have not been merged it's still broken.
How should we go forward on it? Three options come to my mind:

  1. Merge #1197 / #1198 (we're now more early in the release cycle).
  2. Backport this single change from #1197.
  3. Remove reply_handler and error_handler parameters to indicate asynchronous operation isn't supported.

I'm marking this Blocker instead of just Major because I noticed it when I wanted to use asynchronous mode from within an activity.

Change History (3)

comment:1 Changed 11 years ago by sascha_silbe

The situation has changed: While the traceback doesn't happen anymore, find() will return different things in synchronous vs. asynchronous mode. For sync it returns DSObjects, for async the raw data store D-Bus call results.

comment:2 Changed 8 years ago by dnarvaez

  • Component changed from sugar-toolkit to Sugar

comment:3 Changed 8 years ago by dnarvaez

  • Resolution set to fixed
  • Status changed from new to closed

afaik this works these days

Note: See TracTickets for help on using tickets.