Skip to content

Remove some deadcode#11034

Merged
thebentern merged 5 commits into
meshtastic:developfrom
Jorropo:cleanup/dead-code
Jul 16, 2026
Merged

Remove some deadcode#11034
thebentern merged 5 commits into
meshtastic:developfrom
Jorropo:cleanup/dead-code

Conversation

@Jorropo

@Jorropo Jorropo commented Jul 16, 2026

Copy link
Copy Markdown
Member

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

It looks to build.

Summary by CodeRabbit

  • Refactor

    • Streamlined internal filesystem, power-status, radio initialization, web server, and API handling code.
    • Removed obsolete debug, test, and unused helper logic.
    • Simplified public interfaces while preserving existing file management, power monitoring, certificate handling, and network behavior.
  • Bug Fixes

    • No user-facing behavior changes are expected from this update.

@Jorropo Jorropo requested review from Copilot and thebentern July 16, 2026 20:37
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 308dbab6-b96f-4da8-a6a6-fc2f4e5e47ab

📥 Commits

Reviewing files that changed from the base of the PR and between f18a8b0 and 764ac0c.

📒 Files selected for processing (5)
  • src/FSCommon.h
  • src/PowerStatus.h
  • src/mesh/SX126xInterface.cpp
  • src/mesh/http/WebServer.cpp
  • src/mesh/raspihttp/PiWebServer.cpp
💤 Files with no reviewable changes (5)
  • src/FSCommon.h
  • src/mesh/raspihttp/PiWebServer.cpp
  • src/PowerStatus.h
  • src/mesh/http/WebServer.cpp
  • src/mesh/SX126xInterface.cpp

📝 Walkthrough

Walkthrough

Removes obsolete public helper declarations, disabled diagnostic and preference-deletion blocks, and an empty web-response handler stub across filesystem, power, radio, HTTPS, and Raspberry Pi web-server code.

Changes

API and implementation cleanup

Layer / File(s) Summary
Remove obsolete public helpers
src/FSCommon.h, src/PowerStatus.h
Removes the fsListFiles() declaration and PowerStatus::knowsUSB() accessor.
Remove inactive implementation code
src/mesh/SX126xInterface.cpp, src/mesh/http/WebServer.cpp, src/mesh/raspihttp/PiWebServer.cpp
Removes disabled SX126x SPI test code, disabled HTTPS preference deletion logic, and an empty handleWebResponse() stub.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title matches the cleanup theme, but it is generic and doesn't clearly state the main dead-code removals. Rename it to mention the primary cleanup, e.g. "Remove unused declarations and dead code".
Description check ❓ Inconclusive The description has the attestation block, but it omits a clear change summary and is too vague about what was changed. Add a short summary of the removed dead code and note any testing performed, or explicitly say tests were not run.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jorropo

Jorropo commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@NomDeTom is mad about me removing #if 0 blocks.
If you care about this, sure we can keep it but make them a flag (define or config flag or other is fine).

@Jorropo

Jorropo commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

Never mind tom was commenting before looking at the code.
He agrees it's fine to remove now.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR removes unused/disabled code paths and unused API surface area to reduce clutter and keep the codebase leaner.

Changes:

  • Removed unused no-op and disabled debug/testing blocks in HTTP and SX126x initialization code.
  • Removed PowerStatus::knowsUSB() from the public PowerStatus interface.
  • Removed the fsListFiles() declaration from the filesystem common header.

Reviewed changes

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

Show a summary per file
File Description
src/mesh/raspihttp/PiWebServer.cpp Removes an unused empty handler function.
src/mesh/http/WebServer.cpp Removes a disabled #if 0 debug block for cert key deletion.
src/mesh/SX126xInterface.cpp Removes a disabled #if 0 SPI register read/write test block.
src/PowerStatus.h Removes knowsUSB() from the public status API.
src/FSCommon.h Removes the fsListFiles() API declaration.

Comment thread src/PowerStatus.h
Comment thread src/FSCommon.h
@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

@thebentern thebentern merged commit cf0cb90 into meshtastic:develop Jul 16, 2026
40 of 89 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.

3 participants