fix(camera): read the ver140 folder from the card instead of guessing it - #86
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 914aee7194
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const trimmed = directory.trim().replace(/^\/+|\/+$/g, '') | ||
| if (trimmed.includes('contents/')) { | ||
| try { | ||
| return parseDirectoryLocator(trimmed) |
There was a problem hiding this comment.
Reject locators that disagree with the storage argument
When a full directory locator is supplied, this returns the locator's embedded storage and silently ignores the separately required storage argument. For camera api contents.deleteDirectory, conflicting inputs such as storage=card1 with a locator for card2 therefore delete the directory from card2 after the user explicitly selected card1; validate that both storage values match or retain the explicit argument.
AGENTS.md reference: AGENTS.md:L91-L92
Useful? React with 👍 / 👎.
| const { paths } = await session.client.contents | ||
| .listDirectories(storage) | ||
| .catch(() => ({ paths: [] as string[] })) |
There was a problem hiding this comment.
Preserve directory lookup failures
On a ver140 camera, any transient or actionable listDirectories() error—such as a 503 while the body is busy—is converted into an empty directory list. The code then issues a folderless request like contents/card1/100CANON, which normally fails with an unrelated 404 and hides the original cause; propagate the lookup error instead of treating request failure as proof that the directory has no folder.
AGENTS.md reference: AGENTS.md:L86-L86
Useful? React with 👍 / 👎.
`contents list` on an EOS R6 Mark III answered 404: the session put a literal `folder` segment into every ver140 contents path, where the camera expects its own folder name (DCIM for stills), which `contents dirs` already prints. - `contents list` and the contents registry entries take the directory as a bare name (looked up on the card, preferring DCIM), as `DCIM/100CANON`, or as a locator printed by `contents dirs`. - Locators parse through @rawback/ccapi-js, keeping the bare `storage/directory/file` form and the CLI's error message. - A page is listed and then counted, not both at once: a body serves one contents request at a time and answers 503 to an overlap. - `events poll --wait` holds in the style the event endpoint's version takes, so ver110 bodies get `timeout=long` instead of `continue=on`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…event hold
The camera fix reads the ver140 folder with parseDirectoryLocator and
long-polls with event.getPolling({ hold: true }), both new in 1.1.2.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…okup - A directory locator naming another card than the storage argument is refused. It was followed, so `camera api contents.deleteDirectory` with storage=card1 and a card2 locator deleted from card2. - A failed `listDirectories` lookup now surfaces as itself. It was read as "no folders", so a busy or unreachable camera turned into a folderless listing that 404ed for an unrelated reason. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
914aee7 to
7f8f9d0
Compare
Why
On an EOS R6 Mark III (CCAPI 1.4.0),
rawback camera contents list card1 100CANONanswered 404. The session put a literalfoldersegment into every ver140 contents path. The camera expects its own folder name there (DCIMfor stills,XFVC/CRMfor movie reels), andcontents dirsalready prints it:/ccapi/ver140/contents/card1/DCIM/100CANON.Two related issues:
listsentkind=listandkind=numbertogether. A body serves one contents request at a time and answers 503 to an overlap.events poll --waitalways sentcontinue=on, the Ver.1.0.0 hold style. The R6 Mark III servesevent/pollingat ver110, where the hold parameter istimeout.What
Directory argument.
contents list(and--all) plus thecontents.listContents/getContentsNumber/deleteDirectoryregistry entries accept the directory in three forms:100CANON), looked up on the card and preferringDCIMDCIM/100CANONcontents dirsThe
folderSegmentguess is gone. The lookup lives in a newsrc/camera-locators.ts.Locators parse through
@rawback/ccapi-js'sparseContentLocator, keeping the barestorage/directory/fileform and the CLI's error message.Sequential listing. A page is listed, then counted.
events poll --waitmaps togetPolling({ hold: true }):timeout=longfrom ver110,continue=onon ver100.Dependency and docs. Bump
@rawback/ccapi-jsto 1.1.2 (rawback-app/cccapi-js#27).docs/commands.mdand thelisthelp text describe the directory forms.Testing
bun run typecheck,bun run lint,bun run format:checkandbun run buildpass.bun test: 540 pass, 1 fail. The failure isbootstrapConfig > announces a created file on stderr only, which fails identically onmain: the created-file path wraps at the terminal width. It is unrelated to this change.contents/card1/DCIM/100CANON; anXFVC/100CANONreel is present and not picked.--waiton a ver110 endpoint sends?timeout=long, and on ver100?continue=on.DCIMfolder instead offolder.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.