Skip to content

fix: review and update multi-author-blog guide#787

Merged
NoahMaizels merged 5 commits intomasterfrom
fix/multi-author-blog-read-js
Apr 6, 2026
Merged

fix: review and update multi-author-blog guide#787
NoahMaizels merged 5 commits intomasterfrom
fix/multi-author-blog-read-js

Conversation

@NoahMaizels
Copy link
Copy Markdown
Collaborator

@NoahMaizels NoahMaizels commented Mar 31, 2026

Summary

Full review of the Multi-Author Blog guide and its example scripts, fixing bugs found by running the code against a live Bee node:

Bug fixes (read.js in examples repo + guide code block):

  • reader.download()reader.downloadReference(): download() returns raw SOC chunk data with no .reference property, causing bee.downloadFile() to crash with undefined. downloadReference() returns { reference, feedIndex } as needed.
  • new TextDecoder().decode(authorsData.data)authorsData.data.toUtf8(): bee-js Bytes is not a standard ArrayBufferView, so TextDecoder.decode() throws ERR_INVALID_ARG_TYPE. The Bytes class exposes a .toUtf8() method directly.

Content fixes:

  • Replaced stale "Dynamic Note Board" back-reference with correct "Simple Blog" reference from the Dynamic Content guide (the Note Board no longer exists)
  • Added Example Scripts section linking to all runnable scripts in the ethersphere/examples repo (init.js, add-post.js, update-index.js, add-author.js, read.js)
  • Replaced incomplete partial code snippet in "Adding a New Author" with a reference to the new add-author.js script in the examples repo
  • Added Multi-Author Blog card to the Start Building (introduction.md) page

Companion PR in examples repo: ethersphere/examples — adds add-author.js and fixes read.js

Test plan

  • Run node init.js, node add-post.js alice "Title" "Body", node update-index.js, node read.js — should print index feed state, both authors, and homepage URL without errors
  • Run node add-author.js charlie — should add Charlie to the blog and update config.json
  • Confirm Multi-Author Blog card appears on the Start Building page
  • Verify all Example Scripts links resolve correctly to ethersphere/examples

🤖 Generated with Claude Code

Two bugs in the read.js code block:

1. reader.download() returns { payload, feedIndex } with no reference
   property — replace with reader.downloadReference() which returns
   { reference, feedIndex } as needed by bee.downloadFile().

2. bee.downloadFile() returns data as a bee-js Bytes object, not an
   ArrayBuffer — new TextDecoder().decode(authorsData.data) throws;
   use authorsData.data.bytes to get the underlying Buffer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 31, 2026

Deploy Preview for test-twitter-preview-testing-3 ready!

Name Link
🔨 Latest commit b8ada7c
🔍 Latest deploy log https://app.netlify.com/projects/test-twitter-preview-testing-3/deploys/69d36e0471ee7e0008456471
😎 Deploy Preview https://deploy-preview-787--test-twitter-preview-testing-3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

NoahMaizels and others added 4 commits April 3, 2026 05:50
…r-blog guide

- Add Example Scripts section linking to ethersphere/examples repo
- Fix authorsData.data decode: use .toUtf8() instead of TextDecoder + .bytes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Dynamic Note Board no longer exists. The dynamic-content guide now
uses a Simple Blog as its example project. Update the back-reference in
the multi-author blog article accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add add-author.js to the Example Scripts list in the multi-author blog
guide, and replace the incomplete "Adding a New Author" bee-js code
snippet with a reference to the runnable script in the examples repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NoahMaizels NoahMaizels changed the title fix: correct read.js API calls in multi-author-blog guide fix: review and update multi-author-blog guide Apr 6, 2026
@NoahMaizels NoahMaizels merged commit 9f09c2e into master Apr 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant