@makefully/adaptfully 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## 4.2.1 — 2026-09-09
6
+
7
+ ### Fixed
8
+
9
+ - Yap status poll logs only when the status message changes (same as Dutifully), instead of repeating every poll interval.
10
+ - Clearer errors when a chore download/decrypt/unpack fails (helps diagnose truncated Showfully responses).
11
+
5
12
  ## 4.2.0 — 2026-09-08
6
13
 
7
14
  ### Changed
@@ -109,6 +109,8 @@ export async function submitWrapfullyChore ({
109
109
 
110
110
  log(`adaptfully: chore ${choreId} submitted; waiting…`);
111
111
 
112
+ let lastStatus = '';
113
+
112
114
  for (;;) {
113
115
  const statusUrl = `${base}yap/wrapfully/${encodeURIComponent(choreId)}/status`;
114
116
  const {data: status} = await axios.get(statusUrl, {
@@ -123,7 +125,12 @@ export async function submitWrapfullyChore ({
123
125
  throw new Error(status.errors?.[0] || `Chore ${choreId} failed`);
124
126
  }
125
127
 
126
- log(`adaptfully: ${status?.status || status?.state || 'waiting'}…`);
128
+ const message = String(status?.status || status?.state || 'waiting');
129
+
130
+ if (message !== lastStatus) {
131
+ log(`adaptfully: ${message}…`);
132
+ lastStatus = message;
133
+ }
127
134
  await sleep(POLL_MS);
128
135
  }
129
136
 
@@ -293,14 +300,29 @@ export async function send (
293
300
  });
294
301
 
295
302
  if (resultPriv) {
296
- resultBuffer = await decryptResultEnvelope(resultBuffer, resultPriv);
303
+ try {
304
+ resultBuffer = await decryptResultEnvelope(resultBuffer, resultPriv);
305
+ } catch (err) {
306
+ throw new Error(`Failed to decrypt Wrapfully result envelope: ${err.message || err}`);
307
+ }
308
+ }
309
+
310
+ if (!Buffer.isBuffer(resultBuffer) || resultBuffer.length < 4
311
+ || resultBuffer[0] !== 0x50 || resultBuffer[1] !== 0x4b) {
312
+ throw new Error('Chore download is not a valid zip (truncated or corrupt response)');
297
313
  }
298
314
 
299
315
  const destination = mode === 'extract'
300
316
  ? unzipper.Extract({path: `${outputRoot}/`, concurrency: 1})
301
317
  : fs.createWriteStream(`${outputRoot}/${pkg.name}-${pkg.version}-${stage}-${family}.zip`);
302
318
 
303
- await pipeline(Readable.from(resultBuffer), destination);
319
+ try {
320
+ await pipeline(Readable.from(resultBuffer), destination);
321
+ } catch (err) {
322
+ throw new Error(
323
+ `Failed to unpack chore result (${resultBuffer.length} bytes): ${err.message || err}`
324
+ );
325
+ }
304
326
 
305
327
  if (mode === 'extract') {
306
328
  printBuildReport(`${stage}-${family}`, pkg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makefully/adaptfully",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Platform abstraction and Wrapfully deploy client for Makefully games",
5
5
  "type": "module",
6
6
  "main": "./lib/node/index.js",