Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 836170 - [Contact]: Scrolling and Dragging in contact application is very slow #8045

Merged
merged 1 commit into from Feb 14, 2013

Conversation

arcturus
Copy link
Contributor

Fixed all unit tests and problems detected on the unit tests as well.

Rebased and conflicts solved with current master

@@ -290,8 +290,6 @@ if (typeof Contacts.extFb === 'undefined') {
break;

case 'fb_updated':
contacts.List.load();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the line https://github.com/arcturus/gaia/blob/82ed2995ff3585f8e03230a6a9b020e2cfb6c177/apps/communications/contacts/js/fb_extensions.js#L309

When a synchronization finishes, maybe contacts may have been changed so we call to contacts.List.load() when at least one of them have been changed. Now is it ok? I guess you will receive oncontactchange and this call is not necessary anymore, true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the case, when the synch happens, we will receive oncontactchange and will update if necessary.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I understand, so we should remove that as well, right?

@crdlc
Copy link

crdlc commented Feb 12, 2013

I've detected two bugs:

  1. Change the photo on Facebook to an imported friend doesn't work, the contact list is no updated. Go to Facebook in my laptop, change the photo to a friend, after that, I go to import view (the synchronization process finishes) but the contact list is not updated, the image is the same than before.

  2. I have a friend called Manolo from Facebook imported in my contact list. I create a new one called Man. Then I link this one to Manolo on Facebook. Now, I have Manolo friend and Man linked, both of them on the contact list. It fails, I should only have Man linked. The friend should disappear.

@arcturus
Copy link
Contributor Author

Thanks for the feedback Cristian, I understand that the photo is not stored in the contacts photo it self, so a oncontactschange is not fired and we don't have any clue of the change.

Same with the friend linking.

Here we have two actions, either force a change in the contact, or trying to fire a custom event that acts as the oncontactschange.

Thanks for spotting this!

@crdlc
Copy link

crdlc commented Feb 12, 2013

and maybe the same with the company

@jmcanterafonseca
Copy link
Contributor

@arcturus when a link operation happens the local contact is updated in the Contacts DB, so the oncontactschange event should be fired.

The same happens with the photo, even if the photo is updated on other DB the local contact is updated, thus I think something wrong is being done in some place.

@arcturus
Copy link
Contributor Author

@jmcanterafonseca you are right, after doing some tests, even writing some code I realise that you change the contact to specify the new url for the image. So that triggers a onContactsChange, and so far is working.

I tried for both the photo and the company and works as expected.

Same with the linking

@crdlc, is you gecko recent? This oncontactchange was added some days ago, could you update your gecko please?

@crdlc
Copy link

crdlc commented Feb 12, 2013

ok, testing, I updated my gecko one week ago (02-07-13/)

@arcturus
Copy link
Contributor Author

Hi folks, both @crdlc and @albertopq could you try?

I had to modify the addToList method to take into account that it should receive contacts that are facebook or linked to facebook, and pass that extra information to the method for rendering the extra info.

Cheers!

@crdlc
Copy link

crdlc commented Feb 13, 2013

During morning I am going to test it

@jmcanterafonseca
Copy link
Contributor

@arcturus the patch is not working properly. It introduces weird behaviors when linking and unlinking FB Friends. If you link a Contact to a FB Friend temporarily you see the Contact List and afterwards a the Contact detail. Even worst is the case when you unlink a FB Contact on which you temporarily see the unlinked device Contact and then you see the FB Friend Contact.

Please check these behaviors in the current master or train branch just to see how it should be working.

@arcturus
Copy link
Contributor Author

@jmcantera we solve the first and the worst problems.

Hope now are looking ok for you :)

}
showGroup('favorites');
};

function addToFavoriteList(c) {
function addToFavoriteList(favorite) {
var group = 'contacts-list-favorites';
var container = document.getElementById(group);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use headers['favorites'] here?

@crdlc
Copy link

crdlc commented Feb 13, 2013

Sorry it fails, I have an empty list. I import my friend Javi Chiquitin, then I create a new contact called Javi, I link this one to Javi Chiquitin and finally I have two duplicated contacts Javi Chiquitin

@arcturus
Copy link
Contributor Author

@crdlc yep, after suggestions from @albertopq we had the same problem.

Working on it.

@arcturus
Copy link
Contributor Author

Hi guys, lats changes done, and the rebase made with latest PR from @albertopq done as well.

Hope this time everything is really fixed.

if (pendingChanges[id].length >= 1) {
performOnContactChange(pendingChanges[id][0]);
} else {
console.log('No more changes for ' + id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need that in the final version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope definitely not thanks for spoting :) (too much debug yesterday)

@jmcanterafonseca
Copy link
Contributor

@arcturus apart from the two nits found I have not found any other regression concerning FB. Please note I have not tested possible regressions with Web Activities.

@arcturus
Copy link
Contributor Author

@jmcanterafonseca yes we tried WebActivities, but we wanted other people to take a look, anyway QA folks will say something :)

arcturus added a commit that referenced this pull request Feb 14, 2013
Bug 836170 - [Contact]: Scrolling and Dragging in contact application is very slow
@arcturus arcturus merged commit 3859bf4 into mozilla-b2g:master Feb 14, 2013
arcturus added a commit that referenced this pull request Feb 16, 2013
Bug 836170 - [Contact]: Scrolling and Dragging in contact application is very slow(cherry picked from commit 3859bf4)

Conflicts:
	apps/communications/contacts/js/contacts_list.js
	apps/communications/contacts/test/unit/contacts_list_test.js
(cherry picked from commit c48e9eb)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants