Skip to content

Fix/issue 7 scsi check condition request sense - #42

Merged
ashishsinghbora merged 2 commits into
ashishsinghbora:mainfrom
AryanXCode646:fix/issue-7-scsi-check-condition-request-sense
Sep 12, 2026
Merged

ashishsinghbora merged 2 commits into
ashishsinghbora:mainfrom
AryanXCode646:fix/issue-7-scsi-check-condition-request-sense

Conversation

@AryanXCode646

Copy link
Copy Markdown
Contributor

📌 Description

Fixes #(issue)


🏛️ Architectural Layer Impacted

  • Layer 1: UI & API Layer (app/src/main/java/.../ui, service)
  • Layer 2: Flash Engine & Strategy Interface (flasher)
  • Layer 3: Flashing Strategies (linux, windows, ventoy)
  • Layer 4: Filesystem Layer (iso, fat32)
  • Layer 5: Partition Layer (gpt, mbr)
  • Layer 6: Block Device Abstraction (BlockDevice, mock devices)
  • Layer 7: Hardware Transport (scsi, usb, BOT driver)
  • Build & Release Engineering (Gradle, CI/CD, documentation)

🧪 Verification & Quality Checklist

  • ./gradlew lint passes with 0 errors.
  • ./gradlew test passes 100% of unit tests.
  • ./gradlew assembleDebug compiles cleanly.
  • New unit tests have been added using BlockDevice abstractions for modified logic.
  • Memory safety verified (no large heap allocations or whole-file memory mappings).
  • Cooperative cancellation verified (no hanging threads on user cancel).
  • Relevant documentation updated (README.md, ARCHITECTURE.md, LIMITATIONS.md).

🔌 Real Hardware Testing (Optional but Strongly Encouraged)

  • Phone Model:
  • USB Flash Drive:
  • Test Result:

- Explicitly detect SCSI CHECK CONDITION from CSW (status == Status.FAILED)
- Automatically issue SCSI REQUEST SENSE (opcode 0x03) without recursive error handling
- Robustly parse fixed (0x70/0x71) and descriptor (0x72/0x73) sense data
- Map standard SCSI sense keys, ASC, and ASCQ to human-readable structured representations
- Provide ScsiCheckConditionException and ScsiCommandResult for rich caller diagnostics
- Retain backward compatibility while adding throwing variants (readBlocksOrThrow, writeBlocksOrThrow, writeDirectBufferOrThrow)
- Add 21 unit tests (ScsiSenseParserTest, ScsiCheckConditionTest) with mock and simulated BOT tests
- Update documentation and claims auditor to reflect 185 total test methods (184 unit)
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot 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 Pull Request is currently missing implementation details and code changes. While the title indicates it aims to address SCSI status handling, the diff is empty, and the PR description remains a default template. Furthermore, none of the defined acceptance criteria—such as triggering 'Request Sense' or parsing Sense Data—can be verified. The Codacy analysis reports missing requirements for coverage, which is expected given the lack of changes.

About this PR

  • This Pull Request contains no code changes. Please ensure the intended commits have been pushed and are included in the branch associated with this PR.
  • The PR description uses a default template and the verification checklist is entirely unchecked. Please provide a link to the relevant issue and details on how the implementation was tested.

Test suggestions

  • Verify that receiving a CHECK CONDITION (0x02) status triggers a REQUEST SENSE command
  • Verify that Sense Data is correctly extracted and mapped to internal error codes
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that receiving a CHECK CONDITION (0x02) status triggers a REQUEST SENSE command
2. Verify that Sense Data is correctly extracted and mapped to internal error codes

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

@ashishsinghbora
ashishsinghbora merged commit bf5251b into ashishsinghbora:main Sep 12, 2026
3 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.

2 participants