For both functional and scalability reasons, let's impose a reasonable limit to the number of trusted contacts that a user can have. The functional justification here is that it's not possible to trust a large number of people. Facebook limits friends at 5,000. Groups in Commons are unlimited in membership and can be private. Users can still follow an unlimited # of users so if we imposed a limit of 1,000 contacts per-person, I think we'd avoid situations with extreme #'s of contacts (eg, users with 7,000 trusted contacts).

It seems reasonable to me for this limit to be either hard-coded at 1,000 or configurable.

Comments

ezra-g’s picture

Issue tags: +commons 7.x-3.9

Let's set the goal of shipping this feature in February.

ezra-g’s picture

Issue tags: -commons 7.x-3.9 +commons 7.x-3.9 radar
ezra-g’s picture

Assigned: Unassigned » ezra-g

Some suggestions from lea.refice:

- We should clearly display for users where they are relative to their trusted contact limit. I think we could consider making this display optional and only appear when the user is 75% of the way there.
- Rather than changing the appearance of the "Add as trusted contact" buttons, we could instead intercept the request and display a message letting the user know that she has reached her trusted contact limit (or that the other user has reached her own) and that the user will have to remove some contacts in order to add more.

ezra-g’s picture

Status: Active » Needs work
StatusFileSize
new2.15 KB

I made less progress on this than I'd hoped since the last update. Here's a super in-progress stub patch. Marking as "needs work"

ezra-g’s picture

I got a bit more time to work on this this morning. Another progress patch.

japerry’s picture

Status: Needs work » Needs review
StatusFileSize
new7.17 KB

Here is an updated version. It adds a check to make it optional (setting is on the people settings page), and it works when approving or adding a user. Ignored users do not count against the number of trusted contacts.

ezra-g’s picture

  • Commit c1c2b0d on 7.x-3.x by ezra-g:
    Feature #2173637 by japerry, ezra-g: Limit the # of Trusted Contacts...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

axlroach’s picture

What's the rational for the drupal_goto() inside the commons_trusted_contacts_check_limit() function?

Essentially, if $ajax is FALSE and the $exceeds_limit variable is TRUE, then it goes to the front page. Is there a particular reason for this behavior? I'd rather just get back FALSE in this scenario.

axlroach’s picture

We need to be able to count pending memberships toward the trusted contact limit. I had attached a patch that allows an admin to decide whether or not to include pending memberships when calculating a user's number of trusted contacts.

As I thought through this a bit more though, I'm realizing that the use case we have for this is a fairly unique use case and may be best handled outside the context of the commons_trusted_contacts.module. Essentially, we need to count pending and active trusted contacts towards the limit EXCEPT when accepting an incoming pending request. I've hidden the patch file that I attached earlier.

axlroach’s picture

ezra-g’s picture

Status: Closed (fixed) » Needs review

Setting back to "needs review" so that the new patch in #11 isn't lost. In general, it's a best practice to file a new issue for revisions to an existing closed/fixed feature for that reason. Thanks for the patch - we'll take a look!

japerry’s picture

I think we should be adding pending contacts as part of this limit because its possible you could go over the limit otherwise... which means we probably shouldn't have an explicit configuration option for it.

Is there a reason why you guys would need to have the pending user limit disabled?

  • Commit 870e509 on 7.x-3.x by japerry:
    Issue #2173637 by japerry: Add pending contacts to the limit a user can...
japerry’s picture

Status: Needs review » Fixed

I've committed the change to add pending users to the count. If there needs to be an option to disable the pending users, feel free to re-open.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.