Invite/LanternUser code is wrong?
I'm filing a ticket for this because I want to make sure I understand it.
In XmppAvailableServlet, we invite a user if they have not already been invited by this inviter. This calls Dao.addInvite, which checks to see if the sponsor is already in the database. It does not check to see if the invitee is already there; instead, it simply creates a new user for that email address. This seems wrong to me -- what if they already exist?
I think we should use an email address as a unique key for LanternUser, assuming this is possible in App Engine. Does that sound right?
Yes, it sounds like an oversight in the current code. Thanks for catching.
bde7cfc8 is a huge improvement over what we have but I think the whole adding an user when they are first invited is wrong in first place. We should be able to tell which of the invitations was the one actually accepted, and set the sponsor and degree accordingly.
By the way, I imagine this bug may have reset people's invites too, so it may have been confused with #545.
How do we tell which invite has been accepted?
What I had in mind is that in the new invite system a new set of personalized installers is created for each inviter, so we could use that. But I don't think this is future proof. We'll eventually have to treat these installers (and the corresponding servers) as a pool, such that multiple inviters can be assigned to the same server and set of installers.
I think when we allow users to explicitly set and reset trusted peers this "sponsor" will serve no purpose, and the user's "degree" can be chosen as one plus the minimum of the degrees of whoever invited them.
If the latter happens before we start sharing servers, we could conceivably use the installers to identify accepted invitations in the interim. But we can probably just live with this issue (you are stuck to join the trust network at the node corresponding with whoever first invited you) until Bergson.
@leahxschmidt on the original ticket description, that is all accurate. At one point we checked whether a user was invited globally but made the change to check invites by that particular user to allow us to handle followup invites by other users in a different way (different e-mail perhaps?). The corresponding change to addInvite in Dao that should instead only add a user that's not already there never happened, however.
I'm going to mark this as resolved, as we have merged the fix in lantern-controller.
Wait, no I'm not. We need a separate table to store invites, because we really do need to track all of the users that have invited you. I'll add that.
Sounds good.
On Tuesday, February 12, 2013, Leah X Schmidt wrote:
Wait, no I'm not. We need a separate table to store invites, because we really do need to track all of the users that have invited you. I'll add that.
— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/551#issuecomment-13467757.
Sent from Gmail Mobile
The wip branch of lantern-controller now has all this stuff (but I still need to test it)
What is the proximate reason for adding the invites table for Astell?
IIUC, for Astell we create a LanternUser entry when users are first invited, and users are stuck with the "sponsor" who first invited them as their only "trusted" contact ever. Of course this will be fixed in future milestones, but hadn't we settled on this scheme for Astell?
Because we want to send an invitation from A to B only in the case where A has not already invited B. Thus, we need to know whether A has invited B independent of whether B's "sponsor" is A or someone else.
On Wed, Feb 13, 2013 at 7:12 AM, aranhoide [email protected] wrote:
What is the proximate reason for adding the invites table for Astell?
IIUC, for Astell we create a LanternUser entry when users are first invited, and users are stuck with the "sponsor" who first invited them as their only "trusted" contact ever. Of course this will be fixed in future milestones, but hadn't we settled on this scheme for Astell?
— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/551#issuecomment-13488107.
I think that makes sense. I agree @aranhoide we want to be careful about scope creep here, but it sounds like this is already done, and as long as the two of you are synced up on merging this code between your various branches (are you?) I think it should theoretically be alright.
On Wed, Feb 13, 2013 at 9:53 AM, Leah X Schmidt [email protected]:
Because we want to send an invitation from A to B only in the case where A has not already invited B. Thus, we need to know whether A has invited B independent of whether B's "sponsor" is A or someone else.
On Wed, Feb 13, 2013 at 7:12 AM, aranhoide [email protected] wrote:
What is the proximate reason for adding the invites table for Astell?
IIUC, for Astell we create a LanternUser entry when users are first invited, and users are stuck with the "sponsor" who first invited them as their only "trusted" contact ever. Of course this will be fixed in future milestones, but hadn't we settled on this scheme for Astell?
— Reply to this email directly or view it on GitHub< https://github.com/getlantern/lantern/issues/551#issuecomment-13488107>.
— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/551#issuecomment-13507392.
Yes, it does make sense, not a case of scope creep at all. Sorry I'm dense these days.
@leahxschmidt I just noticed this ticket is still open. Should it be, or is this from the history rewrite?
Yeha, I thin kit is closed.