Page MenuHomePhorge

Allow yourself to be Invited in Imported Events
Open, WishlistPublic

Description

I have an external company Calendar with events like "Valerio in vacancy" or "Valerio with customer xxx" so I imported it in my Phorge, trying some integration.

The problem is: imported events are never related to me from Phorge interface.

Examples:

  • I never see my imported events under my Phorge user page.
  • I never see my imported events when filtering on the Calendar by Invitees = myself

Just "Clear Sailing":

Calendar Clear sailing.png (347ร—317 px, 11 KB)

I also tried editing the remote calendar to manually put my email address as Invitee in every event created by me, to somehow convince Phorge. But, just "Clear Sailing". And, I'm just shown as "Private User 1":

Calendar Invitee.png (463ร—745 px, 40 KB)

How to fix the fact that myself is never invited from my personal Imported Calendar?

Understanding the Problem

It seems there is an ICS parser, that works well:

https://we.phorge.it/source/phorge/browse/master/src/applications/calendar/parser/ics/PhutilICSParser.php

It creates an attendees array consisting in simple PhutilCalendarUserNode objects that just have an URI (mailto:), name, and participation status. This seems very OK to me since it's the minimal representation of the ICS file. This object is attached to PhutilCalendarEventNode::addAttendee(PhutilCalendarUserNode).

Now. SOMETHING adapts these UserNode(s) as โ†’ PhabricatorCalendarExternalInvitee storing them with PHIDs PHID-CXNV in the table calendar_externalinvitee. These are then referenced from the table calendar_eventinvitee.

Example row:

SELECT * FROM calendar_eventinvitee;
          id: 1
   eventPHID: PHID-CEVT-r6dcgp7ywxfezn4ao4ju
 inviteePHID: PHID-CXNV-7ku4zm3nz2npk4hgobyk * NOTE CXNV *
 inviterPHID: PHID-CIMP-ahgrfr52h4g5thucrxcs
      status: invited
 dateCreated: 1690538988
dateModified: 1690538988
availability: default

For the Host, this should probably happen instead - since this is what happens when you manually create the Event - so, the column inviterPHID has a bind to a real user (PHID-USER) and not to an external user:

SELECT * FROM calendar_eventinvitee;
          id: 1
   eventPHID: PHID-CEVT-r6dcgp7ywxfezn4ao4ju
 inviteePHID: PHID-USER-7ku4zm3nz2npk4hgobyk * NOTE USER *
 inviterPHID: PHID-CIMP-ahgrfr52h4g5thucrxcs
      status: invited
 dateCreated: 1690538988
dateModified: 1690538988
availability: default

So, something should call PhabricatorCalendarEventInvitee#setInviterPHID() with the most appropriate phid during the import phase.

Proposed solution n. 1: Invitee option

From this page:

https://we.phorge.it/calendar/import/edit/?importType=icsuri

We can add a Default Invitee field, with yourself picked as default.

This should be reasonable since it's the very same thing that happens during manual creation:

https://we.phorge.it/calendar/event/edit/form/7/

Proposed solution n.2: trusting yourself

If the imported event has an email address that matches the Host, the Host should be set as Invitee in Phorge too.

Bonus point: do not show yourself as "Private User 1", but as a normal user link.

CurrentProposed
Before.png (543ร—948 px, 86 KB)
After.png (543ร—948 px, 87 KB)

This solution is safe since you are supposed to know and trust your events and your email address and indeed you may want to match yourself if you are an invitee in the remote event.

Cons: this second solution has not a great margin of expansion because of security reasons. The assumption that is true for the Host cannot be applied to other remote invitees, since someone could craft a remote calendar to invite random emails to try to match existing local Phorge users. Expanding this involves spam and privacy concerns.

So, we can just approach this "trust yourself" solution, remembering to never expand this logic to other participants.

Revisions and Commits

Event Timeline

Any comment about the first proposal would be awesome. Probably it's not so difficult

valerio.bozzolan renamed this task from Imported Events: "Invitees" is broken/incomplete to Allow yourself to be Invited in Imported Events.Jul 28 2023, 14:54
valerio.bozzolan claimed this task.
valerio.bozzolan triaged this task as Wishlist priority.
valerio.bozzolan updated the task description. (Show Details)

So I'm following proposal n. 2 in D25363.

Interestingly both proposals could be implemented and both could make sense to have.