openvibers/openvibe.watch Commits

Watch: How it checks says event and webhook watches work (they have since steps 4 and 5) and names the node carrier (#59)

OP OpenVibers committed 30 days ago · d615c57502 · 2 files, +5 −2

The how-it-works page still said event and webhook watches were "Not built yet: … accepted but never fetched". Both carriers have been live since T18 steps 4 and 5.

- The page now says how they run: an event watch is checked when its Events event arrives; a webhook watch gets a signed `/hooks/` address.
- It adds the node carrier: one read-only check from the owner's own machine, where they turned it on.
- A `run` watch is honest: it waits for a browser worker, is accepted but not checked, and says so on its page.

Found by a new all-sites link sweep (`~/openvibe/work/tools/link-sweep.js`). `site.test.js` pins the corrected copy (23/23).

Changes

ddiff --git a/server/http/pages.js b/server/http/pages.js
iindex 982c2d9..7a86f84 100644
---- a/server/http/pages.js
++++ b/server/http/pages.js
@@@ -955,12 +955,13 @@ ${watchForm({ template, fields, errors, action: `/watches/${id}/edit`, submit: '
<p class="lede">A watch is a promise to look, not a promise to keep asking. Watch knows several ways to find out whether something changed, and it always takes the cheapest one the source allows.</p>
<h2>The order</h2>
<ol>
--<li><strong>An event or a webhook</strong> — when the thing can push to Watch, nothing is polled at all. (Not built yet: a watch of that kind is accepted but never fetched, and says so.)</li>
++<li><strong>An event or a webhook</strong> — when the thing can push to Watch, nothing is polled at all. An event watch is checked when its OpenVibe.Events event arrives; a webhook watch gets its own signed <code>/hooks/</code> address and is checked when a delivery reaches it.</li>
<li><strong>The site's own ETag or Last-Modified</strong> — if the site gave one, the check carries <code>If-None-Match</code>/<code>If-Modified-Since</code>. A <code>304 Not Modified</code> means “no change” and no body is read.</li>
<li><strong>A feed</strong> — an RSS or Atom feed is read before the page it describes, and the feed's own conditional headers apply.</li>
<li><strong>An API</strong> — a JSON endpoint is read the same way, mapped by the watch itself.</li>
<li><strong>A page</strong> — the page's text is read, as the whole body or one element.</li>
--<li><strong>An expensive browser check through OpenVibe.Run</strong> — the last resort, not built yet. A <code>run</code> watch is accepted but never fetched until it is.</li>
++<li><strong>Your own computer</strong> — for something on your home or office network (a router, a NAS, a printer page), one read-only check from your own machine through the OpenVibe Node, only where you turned that on for it.</li>
++<li><strong>An expensive browser check through OpenVibe.Run</strong> — the last resort. It waits for a browser worker, so a <code>run</code> watch is accepted but not checked yet, and says so on its page.</li>
</ol>
<h2>The manners</h2>
<ul>
ddiff --git a/test/site.test.js b/test/site.test.js
iindex 2b002ba..b8deb86 100644
---- a/test/site.test.js
++++ b/test/site.test.js
@@@ -56,6 +56,8 @@ t('the signed-out pages say what Watch is and ask for a sign-in', async () => {
assert.strictEqual(how.status, 200);
assert.match(how.text, /If-None-Match/);
assert.match(how.text, /15 minutes/);
++ assert.match(how.text, /signed <code>\/hooks\/<\/code> address/, 'event and webhook watches are built: the page says how they run');
++ assert.doesNotMatch(how.text, /Not built yet/);
});
t('sign-in with the stand-in Network: PKCE, a session, and /auth/me', async () => {