chitralverma commented on PR #9375:
URL: https://github.com/apache/opendal/pull/9375#issuecomment-7255915449

   (AI-generated reply)
   
   Fixed in 54f0b31c4, which also merges current `main`.
   
   **1. "A read with a zero limit or an empty range."** Reproduced on a release 
build of this branch. On a file containing `abcdef`, `read` and `readSync` 
return `abcdef` with `{ limit: 0 }` (and `{ limit: 0n }`) on both `memory` and 
`fs`, and an empty buffer with `{ size: 0n }`. The Node-only rewrite now 
replaces the full phrase, so the generated declaration reads "A read with `{ 
size: 0n }` validates the read options and capabilities, then returns an empty 
buffer without accessing storage or evaluating conditions against the file." 
([generated.d.ts#L1399](https://github.com/apache/opendal/blob/54f0b31c46b472762f7b4dd381aeaf5f2d5d620b/bindings/nodejs/generated.d.ts#L1399),
 
[nodejs.rs#L344](https://github.com/apache/opendal/blob/54f0b31c46b472762f7b4dd381aeaf5f2d5d620b/dev/src/generate/nodejs.rs#L344)).
 Core keeps its `limit` wording.
   
   The Node.js wording test now asserts that sentence and rejects "zero limit" 
in the `ReadOptions` docs. It fails when the earlier rewrite is restored, as do 
the full-paragraph doc test and the stale-rewrite check.
   
   **2. "Nonempty suffix range."** I applied it. Core `ReadOptions::chunk` now 
says "an open-ended or nonempty suffix range" 
([options.rs#L346](https://github.com/apache/opendal/blob/54f0b31c46b472762f7b4dd381aeaf5f2d5d620b/core/core/src/types/options.rs#L346)).
 I checked this against core with `chunk(4)` on `memory`. A `suffix(0)` read of 
a missing path returns an empty buffer without a stat. A `suffix(3)` read of 
the same path fails with `NotFound` at `stat`, and `2..` does too. The Node.js 
rewrite of that sentence still renders "A read with a positive `chunk` and no 
`size` first stats the file to learn its length."
   
   Running every `ci_odev.yml` generator changes only the Node.js `ReadOptions` 
docs this round; no other binding renders these two sentences. `generated.d.ts` 
still differs from `main` only in the `ReadOptions` JSDoc.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to