Skip to content

ADFA-2488: Fix strictmode disk validation error on sample plugin#1159

Open
Daniel-ADFA wants to merge 1 commit intostagefrom
ADFA-2488
Open

ADFA-2488: Fix strictmode disk validation error on sample plugin#1159
Daniel-ADFA wants to merge 1 commit intostagefrom
ADFA-2488

Conversation

@Daniel-ADFA
Copy link
Copy Markdown
Contributor

@Daniel-ADFA Daniel-ADFA commented Apr 7, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c002e269-8e54-408d-a72b-60c827f4a750

📥 Commits

Reviewing files that changed from the base of the PR and between f57d73b and 72fe1f9.

📒 Files selected for processing (2)
  • app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt
  • subprojects/projects/src/main/java/com/itsaky/androidide/projects/IProjectManager.kt

📝 Walkthrough

Release Notes - ADFA-2488

Changes

  • Menu refresh on project initialization: Added invalidateOptionsMenu() call in ProjectHandlerActivity.postProjectInit() to refresh UI menu items after project setup completes.

  • Plugin project detection refactored: Modified IProjectManager.isPluginProject() to eliminate runtime filesystem checks. The function now returns a cached value computed during project setup instead of checking for plugin API JAR existence on each call.

Risks & Best Practice Considerations

⚠️ StrictMode Violation Fix: This change addresses StrictMode violations caused by disk I/O operations on the main thread. The filesystem existence check is now deferred to the async project initialization phase rather than occurring during synchronous isPluginProject() calls.

⚠️ Behavior Change - Race Condition Risk: If isPluginProject() is called before project setup completes, the method will return false (default) rather than the actual plugin status. Code that relies on accurate plugin detection during initialization should ensure setup has completed first. The cached value relies on ProjectManagerImpl.pluginProjectCached being set, which returns null initially.

⚠️ Silent Fallback: The function silently returns false if the ProjectManagerImpl instance is not available or the cache is null, which could mask issues where plugin detection is needed but hasn't been properly initialized.

Walkthrough

Two focused changes: (1) ProjectHandlerActivity now calls invalidateOptionsMenu() after project initialization completes to refresh the options menu state; (2) IProjectManager.isPluginProject() simplified to return cached value directly without performing filesystem existence checks.

Changes

Cohort / File(s) Summary
Menu Refresh
app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt
Added invalidateOptionsMenu() call immediately after completing project initialization to ensure menu items reflect updated state.
Plugin Detection Simplification
subprojects/projects/src/main/java/com/itsaky/androidide/projects/IProjectManager.kt
Removed filesystem existence check logic from isPluginProject(). Now returns cached pluginProjectCached value directly; eliminated Environment import and caching computation from projectDir + PLUGIN_API_JAR_RELATIVE_PATH path checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A menu refreshes, clean and bright,

Plugin checks now cached just right,

No filesystem wandering today,

Simpler code in every way! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a pull request description explaining the changes made and the rationale behind removing the filesystem existence checks.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references the ticket identifier and describes the main fix: removing strictmode disk validation errors related to sample plugins, which aligns with the filesystem check removal in IProjectManager.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-2488

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 and usage tips.

@Daniel-ADFA Daniel-ADFA requested a review from jatezzz April 8, 2026 08:44
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.

1 participant