From bc48cc8ef5ed1acb63dc33d46cb663e7fea9dd15 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Wed, 15 Jul 2026 19:51:18 -0600 Subject: [PATCH] fix: correct two example bugs caught by skills#70's review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - v5-migration.md: the polling-loop example was missing await on delay(100), turning the intended ~10Hz poll into a tight loop (delay() returns a promise from node:timers/promises). - querying.md: the resellers relationship example pointed `from` at the singular `resellerId`, which the schema never declares — the indexed field is plural `resellerIds`. Both found by a cross-model review on HarperFast/skills#70 (which regenerates its rules from this repo). A third finding from that review — recommending `allowReadRecord` over `allowRead` for record-scoped authorization — was not applied: `allowReadRecord` doesn't exist in Harper; a synchronous `allowRead` override already is the correct record-scoped hook, so that example was correct as written. --- reference/rest/querying.md | 2 +- release-notes/v5-lincoln/v5-migration.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/rest/querying.md b/reference/rest/querying.md index e8c564c7..b05a19c0 100644 --- a/reference/rest/querying.md +++ b/reference/rest/querying.md @@ -225,7 +225,7 @@ type Product @table @export { id: Long @primaryKey name: String resellerIds: [Long] @indexed - resellers: [Reseller] @relationship(from: "resellerId") + resellers: [Reseller] @relationship(from: "resellerIds") } ``` diff --git a/release-notes/v5-lincoln/v5-migration.md b/release-notes/v5-lincoln/v5-migration.md index ded96441..9862c556 100644 --- a/release-notes/v5-lincoln/v5-migration.md +++ b/release-notes/v5-lincoln/v5-migration.md @@ -73,7 +73,7 @@ class MyResource { // this function is within a transaction, with a consistent snapshot of data that won't change, but previous code could // call Table.get without a context, it would not use the current transaction and would instead get the latest data while ((await Table.get(target)).status !== 'ready') { - delay(100); + await delay(100); } return Table.get(target); } @@ -93,7 +93,7 @@ class MyResource { // now we can call Table.get and it will read the latest data. // we could also explicitly start a new transaction here for each get: while ((await transaction(() => Table.get(target))).status !== 'ready') { - delay(100); + await delay(100); } return Table.get(target); }