Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Agent, Actions, Rules & Automation >> How do edicts work?
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1433680809

Message started by Philip Hellyer on Jun 7th, 2015, 8:40am

Title: How do edicts work?
Post by Philip Hellyer on Jun 7th, 2015, 8:40am

My edicts don't appear to be running. Maybe you know why...

The TB help file suggest that edicts should run on startup and then at intervals of approximately one hour, subject to the current implementation details.

Mine have only ever been run when the file is opened or TB is restarted. It's been a day and a half since I created test notes with this self-logging edict code:


Code:
$Text="" + date("today") + "\n" + $Text;


It's been run exactly 3 times, each of which is when the file was opened. It doesn't seem to matter whether the note is modified, the file is saved, TB has been restarted, or any other thing that I thought to try.

Any thoughts as to why they've never run on their own?
Thanks!

Tinderbox 6.3.0 on OSX Mavericks 10.9.5

Title: Re: How do edicts work?
Post by Mark Anderson on Jun 7th, 2015, 11:07am

I'm not sighted as to the exact implementation rules. However, my understanding is the concept is they are for things you want checked occasionally but not often enough to merit the overhead of a rule. In that context, edicts are supposed to happen occasionally in the background and likely at varying periodicity (as other tasks like rules/agents get priority).

Title: Re: How do edicts work?
Post by Philip Hellyer on Jun 7th, 2015, 1:16pm

Thanks Mark! that matches with my understanding. Maybe the implementation hasn't caught up with the intention.

One of my tests is in a file that contains a single note with the above $Edict code, so is competing against 0 rules and 0 agents for priority. It also only seems to run when the file is opened.

I've discovered that edicts are listed on the Agents & Rules Inspector.

Oddly, the inspector is currently (at 18:12) saying that it was last updated 3 hours ago, while the $Text in my note says the last run was at 14:06 (at which time TB crashed and was restarted) But that may just be how the timestamp math works, because a few minutes ago (at 17:58) it said 2 hours ago.

@all: anyone had a different experience with edicts so far?

Title: Re: How do edicts work?
Post by Mark Bernstein on Jun 8th, 2015, 3:43pm

Edicts currently run (a) when the document is opened, and (b) roughly once an hour. (I *think* edicts are suspended when the document is in the background, but I'm not entirely sure.)


Title: Re: How do edicts work?
Post by Philip Hellyer on Jun 9th, 2015, 4:13am

At this point, my edicts are showing as not having run for 36 hours. I started this experiment on the 5th, and since then I've spent several hours with Tinderbox as the active application, though not always working with the files that contain the edicts.

[Since this is starting to sound like a bug, I'll send you my minimal test file. Thanks!]

Title: Re: How do edicts work?
Post by Mark Bernstein on Jun 9th, 2015, 12:49pm

Edicts *should* run hourly, but they don't in Tinderbox 6.3.0. That'll be fixed in the next release.

Also, remember that changes to $Text might not affect the selected note, since that note is "checked out" and Tinderbox gives priority to your changes.

Title: Re: How do edicts work?
Post by Philip Hellyer on Aug 3rd, 2015, 8:48am

The implementation has definitely improved in 6.3.1, thanks very much.

FYI, I'm still not seeing anything like hourly execution. Only two of the below were on the order of an hour, and both of those were an hour after opening the document.

The note with the edict isn't usually selected, so afaict I'm not stepping on my own toes. This behaviour is consistent regardless of whether it's a dedicated test document open in the background, or test note inside a frequently used document.

Here's the log of execution times:

02/08/2015 11:23
01/08/2015 19:22
31/07/2015 21:24      - (Id closed and then re-opened the laptop, and seems that edicts in all documents fired simultaneously, no idea why.)
31/07/2015 13:26      
30/07/2015 18:21      
30/07/2015 11:34      - an hour later
30/07/2015 10:34      - rebooted
30/07/2015 09:10      
29/07/2015 09:45      - an hour later
29/07/2015 08:39      - opened with 6.3.1


Tinderbox 6.3.1 on Mavericks 10.9.5

Title: Re: How do edicts work?
Post by Mark Bernstein on Aug 4th, 2015, 3:28pm

I'm not sure about edicts in the background; I can check if you like.  Email me.

How are you logging the time when edicts run?

Title: Re: How do edicts work?
Post by Philip Hellyer on Aug 5th, 2015, 10:22am

The edict updates its own $Text, like this:

Code:
$Text="" + date("today") + "\n" + $Text;


Since you pointed out (above) that there might be issues with the note text being 'checked out', I've pretty consistently made sure to select a different note after checking on the log.

The timestamps logged this way seem to be consistent with the timing of changes to my other edict-driven items.

Title: Re: How do edicts work?
Post by Mark Bernstein on Aug 6th, 2015, 10:37am

Well set up a test to check this. (Offhand, I dont know whether edicts ought to run when the computer is asleep. )

Title: Re: How do edicts work?
Post by Philip Hellyer on Aug 6th, 2015, 10:55am

This is on a laptop that is often in use for most of the day. I wouldn't expect edicts to run when the computer is asleep.

I might expect any 'overdue' edicts to run when it wakes up or Tinderbox becomes the frontmost application.

I do expect that 'roughly once an hour' corresponds to elapsed clock time, regardless of whether the Tinderbox document was in active use. (i.e. frontmost window in the frontmost application)

I'm not sure what my expectation would be for when Tinderbox isn't the frontmost application. Provided that it 'catches up' somehow, I might never notice.

Thanks for looking into this.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.