-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to TelepathyGLib #837
Conversation
Thanks. Reviewed 5834a7e. Please also check flake8 for your changes. master has 82 flake8 warnings, and 5834a7e has 140. On the other hand, please do not fix flake8 warnings except where you have made changes. A flake8 discovery of importance;
I see again how the change to GObject introspection binding persuades us not to use names in global scope as we did before. Do you think we might instead do something like this;
Benefit would be reduced churn elsewhere in each file, making Noted in progress. Next time create the pull request as draft? |
Thanks, same typo as @chimosky pointed out. I will fix it.
Yes, I agree with you, this would also reduce the work of replacing each telepathy constant appearance in the code.
Thanks will take care of that. Also wanted to know what procedure you follow to test changes in sugar. Thanks |
Thanks. Won't test until all Telepathy static binding imports are removed. Let us know if there is anything blocking that. |
I observed that there are two files having In sugar there is also use of some methods of @quozl @chimosky please guide how to proceed. Thanks! |
Change the use of the methods. Looking at the sources of the static binding API;
I'm not surprised if they have been removed, as they do very little, and steal somewhat some control from the programmer because of the asynchronous actions. Here's what I suggest; List the methods of List the methods of List the methods of Correlate list one with list three. These are the methods known to be used. Intersect list one with list two. These are the methods common to both APIs. List those methods that are in the first list, but not the second list. These are the methods for which a replacement is yet unknown. Call this list four. Discover what those methods in list four are for; i.e. what is their semantic. Discover in each source file how and why those methods are used. Perhaps they are used only because it was the documented way to implement. Using list two, discover what similar methods are in Change the use of the methods in the files Repeat the above for Once you've solved it, make the same changes to sugar-toolkit-gtk3 and collabwrapper modules. (Remember, you're on track; this is exactly what was in the first step of the Port to Python 3 project idea. Don't worry about it taking longer than you planned. That's your inexperience and unfamiliarity, and we all have that at some stage.) |
Thanks, got your point. I agree with you. |
Reference - telepathy sources.
Reference - telepathy sources
Tested sugar head 5027d30 with sugar-toolkit-gtk3 head sugarlabs/sugar-toolkit-gtk3@b3eb986 with Chat activity using two instances of Oracle virtual machines on bridge network running Ubuntu 18.04. The behaviour of neighbourhood view was fine and collaboration worked. |
I have pushed eba6dbe. I made a test with toolkit at sugarlabs/sugar-toolkit-gtk3@64a2296 and with Chat https://github.com/Aniket21mathur/chat/commit/89c94a3587a443b868d9f09d48bae122a4e032fe, using virtual machines, though I am not able to see the X0 icon of the other instance in the neighbourhood view, I am still working on it. :-) Still I request a review, might help in figuring out what is wrong. |
One thing that I noticed is that the changes are not able to handle asynchronous calls.
This function is called and before getting response from .GetInterfaces |
Not surprising, as you have changed when the connection ready callback
is made. It was made when the connection was ready. Now you have
made it occur instantly.
I'm looking at https://github.com/sugarlabs/sugar/pull/837/files in
the patch band from lines 113 onwards.
|
Tested 7a7c533 with Used two oracle virtual machines on a bridged network running Ubuntu 18.04. Everything looks good, neither I am able to reproduce #840 . 😄 Thanks! |
Thanks, that's especially good that #840 does not happen, though it is unfortunate that we don't know why.
I've looked again at the aggregate change, and got a little lost. I'm not sure if you intend every little change, as we have adjusted our goals in the 19 days the pull request has been open.
Could you please do a self-review of https://github.com/sugarlabs/sugar/pull/837/files on a change by change basis and see if there is anything you can do that reduces the amount of change?
Also, please do a test of journal object file transfer from one Sugar user to another?
|
Tested with CollabWrapperTest.
Issue #840 does occur for me.
Several interesting errors in shell.log of Sugar.
http://dev.laptop.org/~quozl/z/1hfeN1.txt is inviter user.
http://dev.laptop.org/~quozl/z/1hfeMl.txt is invitee user.
|
Yes, I will review it again, and will remove extra changes.
Never used that feature before, but I will try testing that.
Thanks for testing.
Thanks, yes indeed it is occurring for me as well, might be possible I didn't reproduced it correctly at that time.
I will have a look into them :-) |
I am not able to test file transfer, between the users, didn't get how to do that. I followed this tutorial. Need help. |
Tested 934c72a with toolkit at sugarlabs/sugar-toolkit-gtk3@a7245f9 and Chat master.
I am still not able to test file transfer. Thanks! |
Here's how to test;
1. ensure buddy icons in neighbourhood view, make friend, and create
a journal object, such as a Write document,
2. on the sending system, in the Journal, right-click and "Send to"
the buddy representing the receiving system,
3. on the receiving system, a notification will appear in top left
corner, press F6 for Frame, right-click on the download icon, and
click accept; the journal object will be copied,
4. on the sending system, press F6 for Frame, right-click on the
upload icon, and click dismiss,
5. on the receiving system, press F6 for Frame, right-click on the
upload icon, and click dismiss,
6. validate the content of the journal object by opening it.
Look at shell.log for any interesting errors or warnings.
https://help.sugarlabs.org/en/journal.html#sending-journal-entries-via-a-network
is a bit brief, it could do with more detail.
|
Thanks. Tested Collaboration as well as File transfer with 30c11eb. Looks fine. |
Surprising, but I don't get any related to collaboration. Way I followed~
Compare the logs. Updates I am getting some occassional errors:
and
|
Good, thanks. They shouldn't be kept. They hinder testing. When will you fix them? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed as-at 30c11eb.
src/jarabe/model/buddy.py
Outdated
conn_proxy = bus.get_object(service, path) | ||
self._prepare_conn_cb(path, conn_proxy) | ||
|
||
def _prepare_conn_cb(self, object_path, conn_proxy): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function name does not use our style; it is not a callback, so the name should not end in _cb
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noticing.
for conn in Connection.get_connections(bus): | ||
conn.call_when_ready(self._conn_ready_cb) | ||
bus_object = self.bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus') | ||
for service in bus_object.ListNames(dbus_interface='org.freedesktop.DBus'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a synchronous call to D-Bus; can it be made asynchronous?
This method of asking D-Bus to list names, only to locate names that represent connections, causes traffic on D-Bus. Could we instead keep a list of connections and iterate through that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Made a list of connections, to iterate through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's not what I meant. I'll try again.
In master the ConnectionWatcher calls get_connections, a method of the Connection class. In client/conn.py of telepathy-python sources, this is revealed to be a synchronous call to ListNames. Each detected name is then used to create a new Connection.
Synchronous calls are to be avoided because they can force interprocess context switches, clearing processor caches, and delay response by the application that makes the call. So I'm asking if we can avoid synchronous calls by either avoiding the ListNames call altogether (by caching our own list of connections), or if we are not in command of the list of connections (e.g. because they can be created by other processes), at least make the call to ListNames asynchronous, which would require changes to respond to the completion event.
However, if you can say "ListNames completes without requiring action by other processes", I'd say leave it synchronous.
Is there an equivalent feature in TelepathyGLib that we can look at to understand, though not to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or if we are not in command of the list of connections
Yes we are not in command of that I have checked that with developing list of services with and without sugar. Also the same service have unique id's for different users.
[dbus.String(u'org.freedesktop.Telepathy.Connection.salut.local_xmpp.e26599a6')
The 8 digit hash at the last differ for different users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's not what I meant. I'll try again.
Thanks. I think I understood your point this time. What we want is to make the synchronous ListNames
call an asynchronous call. I have pushed 0b9bcef in favor of that, please review.
Tested 0b9bcef.
Logs contained;
This is adjacent to one of your changes, so any ideas? |
Thanks. Reproduced; #840 happened in the previous test step; when Chat was stopped. |
Fixes #836
This is an in progress pr.