twitter / GraphJet

GraphJet is a real-time graph processing library.
Apache License 2.0
713 stars 111 forks source link

Add fix to cover an edge case in tweet unfavorite path #106

Closed guimingTang closed 6 years ago

guimingTang commented 6 years ago

Background: In the previous pull request I added the functionality to index unfavorite edges, so they can be used to "remove" the corresponding favorite edges. The core idea is that, for each tweet (nodeInfo), check both favorite edges and unfavorite edges, find intersection, remove the intersection, and lastly remove the remainder unfavorite edges. The end result will appear as if unfavorited edges are removed.

Problem: I neglected a corner case where favorite edges == null and unfavorite edges != null. This allowed the call path to skip the entire unfavorite check, and unfav social proofs will not be checked or removed. This pull request covers that corner case, and added tests to cover it.

Also I moved the fave and unfav edge type definitions to RecommendationRequest.java, where most of the constants are already defined, to reduce duplication.

CLAassistant commented 6 years ago

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


gtang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.