The daily free-run counter could take the whole run down. The gate had no
try/catch at all: checkAndIncrementFreeRuns called openGateStore(),
getValue() and setValue() in the open, so any failure propagated straight
out and killed the run. Apify's automated QA executes under
LIMITED_PERMISSIONS, where the named-store REST create is rejected — so this
fired on QA runs.
The whole open→get→set sequence now sits in one try. On failure the gate
reports through log.error + log.warning and returns
{allowed:true, degraded:true, degradedReason}, so the run continues
uncapped for that run. A genuinely exceeded cap still returns allowed:false
and remains a hard stop — that is the one case where failing closed is right.
A successful fetch could end with an empty dataset and no error. pushData
and setValue('SUMMARY', ...) fail silently under LIMITED_PERMISSIONS —
the SDK swallows the permission error, the run still reports SUCCEEDED, and
the caller cannot tell "found nothing" from "found something I could not
store". Confirmed on a live run: content was fetched (title and length in the
log) while the dataset held 0 items and SUMMARY was absent entirely. Both
writes are now wrapped, and a blocked dataset write sets an explicit status
message instead of passing for success.