Skip to content

fix(installer): treat "No such file or directory" as an empty developer slot#51

Merged
altaywtf merged 1 commit into
mainfrom
fix/empty-slot-delete
Jul 24, 2026
Merged

fix(installer): treat "No such file or directory" as an empty developer slot#51
altaywtf merged 1 commit into
mainfrom
fix/empty-slot-delete

Conversation

@altaywtf

Copy link
Copy Markdown
Member

Problem

On older Roku devices (e.g. Roku Stick 3500X), deleting or replacing an already-empty developer slot returns:

Delete Failed: No such file or directory

isEmptyDeveloperSlotMessage only matched "no plugin installed" (the newer-device phrasing), so:

  • deleteInstalledChannel failed on an empty slot instead of succeeding idempotently, and
  • installPackageEffect's Replace→Install fallback (which keys off isEmptyDeveloperSlotMessage) didn't trigger.

Surfaced downstream in putdotio/putio-roku (2.4.1 fixed the "Delete Succeeded" case in #50; this is the remaining empty-slot edge — pnpm sideload onto an empty slot still errored).

Fix

Recognize both empty-slot phrasings:

export const isEmptyDeveloperSlotMessage = (message: string): boolean =>
  /no plugin installed/i.test(message) || /no such file or directory/i.test(message);

Both call sites benefit: delete becomes idempotent on an empty slot, and a Replace install falls back to a fresh Install. "No such file or directory" is only reached in the installer delete/replace path, where it unambiguously means "no dev package present."

Verification

  • New test/installer-message.test.ts covers both empty-slot phrasings and the delete-success classifier (incl. a regression check on "Delete Succeeded.").
  • pnpm verify green (vp check + tsc --noEmit + vp run test + npm pack --dry-run).

🤖 Generated with Claude Code

…er slot

Deleting or replacing an already-empty developer slot on older Roku devices
(e.g. Roku Stick 3500X) returns "Delete Failed: No such file or directory"
rather than "no plugin installed". isEmptyDeveloperSlotMessage only matched the
latter, so deleteInstalledChannel failed on an empty slot and a Replace install
would not fall back to a fresh Install.

Recognize both phrasings as an empty slot, making delete idempotent and the
install Replace->Install fallback work on older devices. Adds unit coverage for
the empty-slot phrasings and the delete-success classifier.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 24, 2026 15:15
@altaywtf
altaywtf merged commit 3e060e8 into main Jul 24, 2026
4 checks passed
@altaywtf
altaywtf deleted the fix/empty-slot-delete branch July 24, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Roku developer-installer message classification so that older-device responses for deleting/replacing an already-empty developer slot are treated as an “empty slot” condition. This makes delete idempotent on empty slots and allows Replace→Install fallback to trigger reliably.

Changes:

  • Extend isEmptyDeveloperSlotMessage to also recognize the older "No such file or directory" empty-slot phrasing.
  • Add focused unit tests covering both empty-slot phrasings and delete-success classification.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/installer-message.ts Broadens empty developer-slot detection to include older-device wording, affecting delete idempotency and Replace→Install fallback behavior.
test/installer-message.test.ts Adds regression coverage for the expanded empty-slot classifier and for delete-success classification (including "Delete Succeeded.").

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

putio-release-bot Bot added a commit that referenced this pull request Jul 24, 2026
## [2.4.2](v2.4.1...v2.4.2) (2026-07-24)

### Bug Fixes

* **installer:** treat "No such file or directory" as an empty developer slot ([#51](#51)) ([3e060e8](3e060e8))
@putio-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants