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

SAK-49949 tasks Soft delete tasks for soft deleted sites #12945

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adrianfish
Copy link
Contributor

@@ -21,11 +21,11 @@
<bean id="org.sakaiproject.tasks.api.TaskService"
class="org.sakaiproject.tasks.impl.TaskServiceImpl" init-method="init">

<property name="transactionTemplate">
<!--property name="transactionTemplate">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@adrianfish adrianfish requested a review from jesusmmp October 11, 2024 11:03
@adrianfish
Copy link
Contributor Author

@ern SOFT_DELETED because they mimic site soft deletion. If the sites are restored, then the tasks are too.

@ern
Copy link
Contributor

ern commented Oct 14, 2024

Yeah I understand that but I am not convinced it makes sense to mark the data as softly deleted if the site is softly deleted.

Simply checking if the site is softly deleted (SAKAI_SITE.IS_SOFTLY_DELETED) should be enough to say don't load tasks from this site.

@adrianfish
Copy link
Contributor Author

Ok, fair enough. I can do that.

@adrianfish
Copy link
Contributor Author

adrianfish commented Oct 30, 2024

@ern Updating to check all the sites when loading up the synoptic tasks would take potentially a lot of calls to the site service. I know they are cached, but still. So, a user may have a set of tasks from 5 sites. Everytime getCurrentTasksForCurrent user is called, that would mean a site retrieval for each task. Caching would help, of course, but it still feels heavy. So, it's a tradeoff between keeping soft deleted in sync between tasks and the site, with a DDL change, or a potentially heavy hit on the site service. Tasks will be called everytime a user hits the dashboard.

@@ -95,7 +98,10 @@ public void update(Observable o, Object arg) {
if (event.getEvent().equals(SiteService.SECURE_UPDATE_SITE_MEMBERSHIP)) {
try {
Set<String> siteUsers = siteService.getSite(event.getContext()).getUsers();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is out of scope for your PR, just an FYI for anyone following. event.getContext() is usually null here. also it can get called thousands of times in quick succession during SIS updates ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically, if students are being added one by one, this will be a big hit as it will be pulling the list of students from the site on every event?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's just an annoyance as this can be a big NPE .... i'm okay with the getUsers pull because it should be cached

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it get cached though, if the site members have been updated before the event was fired? Anyway, how often would a big SIS update like that happen?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe five times a day

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.

4 participants