History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SAK-7670
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Carl Hall
Reporter: Kristol Hancock
Votes: 5
Watchers: 12
Operations

If you were logged in you would be able to see more operations.
Sakai

Creating: Notification of items with release dates should be at release time

Created: 17-Jan-2007 13:14   Updated: Thursday 02:09 AM
Component/s: Resources
Affects Version/s: 2.3.0, 2.4.0, 2.3.x, 2.5.0, 2.3.1, 2.3.2, 2.4.1, 2.5.2, 2.5.3
Fix Version/s: 2.6.0

Time Tracking:
Not Specified

File Attachments: 1. File Exception.rtf (7 kb)
2. File sak-7670-content.diff (13 kb)

Environment: http://nightly2.sakaiproject.org
Issue Links:
Depend
 
Incorporate
 
Relate
 

2.4.x Status: None
2.5.x Status: None


 Description  « Hide
If I set a beginning date/time for a resource item to some date/time in the future and I choose to send an email notification, site participants receive the email notification immediately and upon selecting the link in the notification for the item, have access to the resource regardless of the begin date/time that i set. I would expect that the notification would not be sent out until the beginning date/time arrives. Please let me know if you need any additional information. Thanks!

Also no notification for hidden items.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
John Leasia - 17-Jan-2007 13:18
Also, I would think that they shouldn't have access to it until the start time.

Steve Lonn - 13-Feb-2007 07:01
We've also received comments on this issue here at Michigan from our users.

Is there any planned work on this issue for 2.4 or 2.5?


Stephen Marquard - 13-Feb-2007 07:26
On our 2-3-x production build (r21164), site participants get the notification immediately, but they don't have access to the resource if it's not yet available - the URL returns a 403 forbidden error, which is what it should do.

Jim Eng - 08-Apr-2007 12:50
It's possible this could be done for 2.4, but I think it's too late in the QA process to deal with it for the release. As I understand it, we need to check the release date when creating a resource and schedule a notification with the job scheduler if the release date is in the future. If there's no release date or the release date is in the past, we would send the notification immediately. We will need to consult Andrew Poland for details.

Harriet Truscott - 09-Apr-2007 09:20
If we can't fix this for 2.4, we will alter the instruction text about the release and retract dates to explain that email notifications will go out immediately.

Harriet Truscott - 30-Apr-2007 08:02
This is now mentioned in the help text.

Jim Eng - 17-May-2007 07:44
No notification if item is hidden, until it is unhidden.

Steve Lonn - 17-May-2007 07:46
For hidden resources: Possibly also hide the notification option for hidden resources or only send notifications to those that have permission to see hidden resources.

Jim Eng - 12-Dec-2007 14:54
Clay,

Is it possible that Stuart or Carl could work on this ticket and give me a patch to handle it?

As I understand it, the proposal is that we use jobscheduler to trigger a notification in the future. But if the release date of the resource changes or the resource is moved or deleted, the previously scheduled notification would need to be deleted and a new one issued.

If that's the case, it's likely that the key changes would be in the commitResource method. If the item is hidden or a release date in the future is set, the normal notification should be omitted and (in the case of a release date in the future) the notification should be scheduled.

Many people consider this a critical bug. If we have a relatively low risk fix soon, we could ask to include it in 2.5. If you're not able to look at it, please assign back to me and I will set the target to 2.6.

Thanks.

Jim

Clay Fenlason - 12-Dec-2007 15:14
Carl,

Please take a look at this and see if you can get a patch out. The next RC is scheduled the second week of January, I believe, so the patch would be needed in time to test.

Peter A. Knoop - 18-Jan-2008 07:37
From Carl Hall:

I'm detailing some last pieces of the email service functionality
(SAK-12581). We're hoping to roll this out with the mailtool for our
testing so that we don't double our test efforts. I'll be able to
start on SAK-7670 early next week with the expectation of this making
it into the 2.5 release. I'll be sure to update the JIRA as things
progress. Thanks for reminding of this issue.

Carl Hall - 06-Feb-2008 14:23
Handling a deferred email has turned into a bigger problem of how to fire an available/unavailable event for resources in CHS. Since this is being handled after 2.5 has an RC, the current discussion for a temp fix is to add language to the email notification that the resource will be available on mm/dd/yyyy date. I'll include a link to the Gmane conversation as soon as Gmane picks it up.

Carl Hall - 13-Feb-2008 16:21
Patch to add language to email notification if the resource is not yet available.

Peter A. Knoop - 14-Feb-2008 06:44
The temporary fix Carl has produced for Sakai 2.5.0 is being tracked in SAK-12973, so that this issue can remain open for further work to fully address the issue at hand.

Peter A. Knoop - 14-Feb-2008 06:48
Carl, I've moved the patch with your temporary fix to SAK-12973, and assigned it to Jim to review for merging.

Carl Hall - 21-Apr-2008 15:19
Patch for 'content' changes related to this JIRA.

Carl Hall - 21-Apr-2008 15:20
Patch for 'event' changes related to this JIRA.

Carl Hall - 21-Apr-2008 15:25 - edited
Fixed by serializing certain parts of the event and notification objects into the context of a scheduled invocation command. This context is then used when the invocation is run by the scheduler to have the same required data as if running without the delay.

[Edit: previously thought to have found a bug in CHS. The bug was in my code, so I removed the details of the issue from here]

Carl Hall - 21-Apr-2008 15:45
Updated with fix for determining collection and resource then using CHS correctly.

Peter A. Knoop - 22-Apr-2008 05:53
Jim, can you review these patches and merge to trunk? Thanks.

Ian Boston - 22-Apr-2008 15:39
2 issues with the patches.

1. the Event patch has added methods and parameters, but there is no javadoc. IMHO there should be, expecially with a patch to a stable piece of code that is not often looked at.


2. A blocker at the moment, sorry.

This binds Content to job scheduler. The job scheduler API is present in framework, but there is No impl because the impl pulls in lots of things. You should not assume the impl is present.

Thats not the blocker, the following is.

Parts of content are part of Kernel, and this patch pulls in jobscheduler, which will make the kernel much bigger. It is possible to add providers without the dependencies, and this has already been done in content, please follow this pattern to make certain that we dont increase the size of kernel.

Have a look at the content-impl-providers package.

You are probably safe putting things into modules that appear only in the full profiles in the base pom of content.



Carl Hall - 22-Apr-2008 17:02
I agree with both issues. I'll work on getting both of the noted issues resolved ASAP.

Carl Hall - 29-Apr-2008 13:30
New patches that move the dependencies to content-impl-providers rather than in the content kernel stuff. Patches also halt an event from fully firing and write it off to a holding db table until a scheduled delay calls for it.

Carl Hall - 29-Apr-2008 13:35
Reworked the code to follow Ian's suggestions. New solution has a db table to hold the event delay information, moves the dependencies to content-impl-providers and catches the event before firing.

Carl Hall - 29-Apr-2008 13:36
Updated patch with javadocs.

Carl Hall - 05-May-2008 11:47
Added source in test file for event tracking service to make the build work.

Ian Boston - 07-May-2008 14:44
Will apply

Ian Boston - 07-May-2008 15:23
Applied patch ok, and committed


Ian Boston - 07-May-2008 15:24
Kristol,
Please test, thanks

Ian

Aaron Zeckoski - 08-May-2008 00:35
This seems to have broken the trunk build:

http://saffron.caret.cam.ac.uk/continuum/servlet/continuum/target/ProjectBuild.vm?view=ProjectBuild&buildId=11439&id=1

Looks like there is something in memory that was mocking the event service so when the event service API changed the memory build failed.

[INFO] Building sakai-memory-impl
[INFO] task-segment: [clean, install, sakai:deploy]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /usr/local/continuum-1.0.3-public/apps/continuum/working-directory/1/memory/memory-impl/impl/target
[INFO] Deleting directory /usr/local/continuum-1.0.3-public/apps/continuum/working-directory/1/memory/memory-impl/impl/target/classes
[INFO] Deleting directory /usr/local/continuum-1.0.3-public/apps/continuum/working-directory/1/memory/memory-impl/impl/target/test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 6 source files to /usr/local/continuum-1.0.3-public/apps/continuum/working-directory/1/memory/memory-impl/impl/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
Compiling 5 source files to /usr/local/continuum-1.0.3-public/apps/continuum/working-directory/1/memory/memory-impl/impl/target/test-classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/usr/local/continuum-1.0.3-public/apps/continuum/working-directory/1/memory/memory-impl/impl/src/test/org/sakai/memory/impl/test/MockEventTrackingService.java:[34,7] org.sakai.memory.impl.test.MockEventTrackingService is not abstract and does not override abstract method deleteVoter(org.sakaiproject.event.api.EventVoter) in org.sakaiproject.event.api.EventTrackingService


Stephen Marquard - 08-May-2008 00:44
Could we have some documentation on how this works before it's merged to 2-5-x?

Also how does it affect records in the SAKAI_EVENT table and event-observing tools such as SiteStats?

Ian Boston - 08-May-2008 04:42
Carl,
Stephen needs some doc before merging, I will fix the build failiure that is currently happening in trunk.

Ian

Carl Hall - 08-May-2008 06:39 - edited
This patch allows for an event to be voted on before it is processed. If any votes against an event are received, the event is not processed. The voter that is introduced with this patch will vote against an event if it is a) an add, remove or write event AND b) associated to a resource that isn't available yet. The information about the event is saved off into a separate table from SAKAI_EVENT in case that table is archived which seems to be common practice due to this table's high record count. A delayed invocation is scheduled that recreates the event based on the associated resource's availability and sends it back through for processing using the normal means (looks like the event was just fired). Before scheduling a delayed invocation, all other scheduled delayed invocation associated to the resource are removed.

This shouldn't have any adverse affect on event-watching tools as the events can be trapped/voted on before any notifications are sent out. Let me know if there any other questions or if I should cross-post the "docs" somewhere else.

Stephen Marquard - 08-May-2008 07:08
It seems the code will delay content.new, content.delete, etc. I don't think this is appropriate for other consumers of this event data.

For example, for a new content item, I want it indexed immediately (search events consumer) and reflected in site stats immediately (another consumer).

Maybe there should be a new event, content.notify ?

Ian Boston - 08-May-2008 15:42
Issues over build errors now fixed.

Ian Boston - 08-May-2008 15:46
If the content is indexed, then the fact it exists will become apparent, although the item itself or the title will not. A search for a key word in the course will expose the fact there are items there. If they were not indexed then nothing would show.

Megan May - 09-May-2008 12:00
When a resource is added with a date in the future an exception relating to a table not existing is thrown. I'm attacking the exception I got on r46346 of trunk.

Carl Hall - 09-May-2008 12:50
The table mentioned can be created by running the appropriate script (db specific) found in the patch on this JIRA. I didn't wire it up to run automatically mostly because I don't know how to do that.

Megan May - 09-May-2008 13:14
Carl, ootb the table needs to be created using autoddl. It becomes too hairy to install Sakai if each tool has special scripts that need to be run inorder for the app to work. I bet someone on the dev list could help you or you could ping someone (Ian, Aaron, Steve G, Oliver) directly. Also, the script s in the patch need to be added to the conversion script in reference. We're got to have those two things before this can be merged into the 2.5.1 release

Stephen Marquard - 09-May-2008 13:28
I'm also not convinced that the solution here is appropriate, in that in fixing one behaviour it changes other aspects of behaviour (i.e. delays propagation of content.* events, if I understand correctly). I'd like to see some discussion of that before we finalize this in trunk and consider merging to 2-5-x.

Carl Hall - 22-May-2008 08:41
A patch to add auto.ddl awareness to the module.


Stephen Marquard - 15-Jun-2008 11:39
Committed the auto.ddl patch in r47474 so the table is created on startup.

Related to SAK-10801, the event code here may need to persist and read back a new CONTEXT field.

Also other than the issue discussed on sakai-dev about delaying events that other consumers may want immediately, perhaps some of the delayed event code here belongs in the event module rather than content? What would happen if another client had a similar use case (e.g. notification for a test/quiz not yet open) ?


Stephen Marquard - 16-Jun-2008 11:50