Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add favorites to Outlook calendar #184

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Conversation

alexiri
Copy link
Contributor

@alexiri alexiri commented Nov 15, 2024

Add favorite events and categories to Outlook calendar.

For favorited categories, only new/updated events are added to the calendar because Indico is missing the signals signals.users.favorite_category_added and signals.users.favorite_category_removed.

Depends on indico/indico#6618

@alexiri alexiri force-pushed the favorites branch 3 times, most recently from 351f2c2 to 53b257e Compare November 16, 2024 18:26
@alexiri
Copy link
Contributor Author

alexiri commented Nov 23, 2024

Regarding the concern of somebody marking Home as favorite, this is actually already an issue for the calendar exporter feature: you can export an ical file for the entire Indico instance. It takes a little while on the CERN instance and produces an ical file with 6114 events (for me, users with more access will probably get more), all ending in the future.

With the code as it's implemented now, marking a category as favorite wouldn't affect that many events because it's no longer fully recursive. Even if it were, though, this may not really be an issue depending on how indico outlook is executed. I had assumed it would be a celery task, but it doesn't look like it is and I can't find how it's triggered nor how often. I think as long as multiple executions aren't allowed to overlap, the impact of a large quantity of updates should be fairly limited.

@ThiefMaster
Copy link
Member

Even if it were, though, this may not really be an issue depending on how indico outlook is executed. I had assumed it would be a celery task, but it doesn't look like it is and I can't find how it's triggered nor how often. I think as long as multiple executions aren't allowed to overlap, the impact of a large quantity of updates should be fairly limited.

It is. See outlook/indico_outlook/__init__.py (once every 15 minuts, and yes by default we lock tasks so they do not overlap). And it's not so much about not wanting the task to take long (it's already fairly slow as it is though!), but rather avoiding to accidentally add 100s or 1000s events to someone's calendar.

Regarding the concern of somebody marking Home as favorite, this is actually already an issue for the calendar exporter feature: you can export an ical file for the entire Indico instance. It takes a little while on the CERN instance and produces an ical file with 6114 events (for me, users with more access will probably get more), all ending in the future.

Actually your comment just reminded me of the perfect solution! We have something called visibility. Add a .filter(Event.is_visible_in(favorite_category_id)) to the query for events (unfortunately this does not accept multiple categories, BUT you could possibly use the CTE for visibility information directly - check the code if is_visible_in!). I think visibility check AND access check together may be pretty reasonable to stop people from doing stupid things and flooding their calendar.

@alexiri
Copy link
Contributor Author

alexiri commented Nov 23, 2024

After 4386d9a, this PR now depends on indico/indico#6618.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants