Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ object BuildPreferences {

/** Switch for Gradle `--offline` option. */
var isOfflineEnabled: Boolean
get() = prefManager.getBoolean(OFFLINE_MODE, false)
get() = prefManager.getBoolean(OFFLINE_MODE, true)

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the BuildPreferences.kt file to see the context around line 70
cat -n preferences/src/main/java/com/itsaky/androidide/preferences/internal/BuildPreferences.kt | head -80 | tail -20

Repository: appdevforall/CodeOnTheGo

Length of output: 806


🏁 Script executed:

# Let's see more context around this change - look at the full OFFLINE_MODE property
rg "OFFLINE_MODE" preferences/src/main/java/com/itsaky/androidide/preferences/internal/BuildPreferences.kt -B5 -A5

Repository: appdevforall/CodeOnTheGo

Length of output: 974


🏁 Script executed:

# Check if there's git history or metadata about what the previous default was
git log --oneline -20 -- preferences/src/main/java/com/itsaky/androidide/preferences/internal/BuildPreferences.kt

Repository: appdevforall/CodeOnTheGo

Length of output: 102


🏁 Script executed:

# Look for GradleBuildService and how it uses OFFLINE_MODE
fd -t f "GradleBuildService"

Repository: appdevforall/CodeOnTheGo

Length of output: 236


🏁 Script executed:

# Search for usage of OFFLINE_MODE across the codebase
rg "OFFLINE_MODE" --type java -A2 -B2

Repository: appdevforall/CodeOnTheGo

Length of output: 50


🏁 Script executed:

# Check the PR description or branch information if available
git branch -a | head -20

Repository: appdevforall/CodeOnTheGo

Length of output: 168


🏁 Script executed:

# Look at GradleBuildService directly for usage of isOfflineEnabled or OFFLINE_MODE
cat -n app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildService.kt | grep -i "offline\|isoffline" -B3 -A3

Repository: appdevforall/CodeOnTheGo

Length of output: 370


🏁 Script executed:

# Search for all usages of isOfflineEnabled across the codebase
rg "isOfflineEnabled" --type java -B2 -A2

Repository: appdevforall/CodeOnTheGo

Length of output: 50


🏁 Script executed:

# Check the git commit to understand the context of this change
git show 02ca06cb --stat

Repository: appdevforall/CodeOnTheGo

Length of output: 50381


🏁 Script executed:

# Check if there's a PR or issue description that explains the intent
git log --format="%H %s %b" -1 02ca06cb

Repository: appdevforall/CodeOnTheGo

Length of output: 135


🏁 Script executed:

# Look at what getGradleExtraArgs actually does
fd -t f "GradleBuildService.kt"

Repository: appdevforall/CodeOnTheGo

Length of output: 146


🏁 Script executed:

# Get the actual file to see the implementation
cat app/src/main/java/com/itsaky/androidide/services/builder/GradleBuildService.kt | head -500 | tail -200

Repository: appdevforall/CodeOnTheGo

Length of output: 5744


🏁 Script executed:

# Check PR description or commit body for intent
git log -1 --format="%B" 02ca06cb | head -50

Repository: appdevforall/CodeOnTheGo

Length of output: 94


🏁 Script executed:

# Check if there's any test-only annotation or related changes in the same commit
git show 02ca06cb --name-only | grep -i test | head -20

Repository: appdevforall/CodeOnTheGo

Length of output: 1645


Offline mode should not become the production default without clear intent.

This commit changes OFFLINE_MODE default from false to true and targets the stage branch. With this change, Gradle builds will append --offline by default for all users (see GradleBuildService.kt lines 479–480), which breaks dependency resolution for projects requiring remote artifacts.

Two specific concerns:

  • Existing users who never toggled this setting will silently switch to offline mode on upgrade, since SharedPreferences.getBoolean returns the new default only when the key is missing.
  • The commit message ("make offline mode default") suggests this is intentional, but provides no context about whether this is a permanent production change or a temporary test harness.

Before merging to stage:

  • Clarify whether this is meant to ship as the new default behavior or revert to false.
  • If shipping, coordinate with docs/release notes to document this user-facing change.
  • If this is test-only, use a debug-build-only override or separate experiment branch instead of changing the production default.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@preferences/src/main/java/com/itsaky/androidide/preferences/internal/BuildPreferences.kt`
at line 70, The OFFLINE_MODE getter in BuildPreferences.kt currently uses
prefManager.getBoolean(OFFLINE_MODE, true) which silently flips the default to
true for all users; revert the production default to false or make it
debug-only: either change the fallback to prefManager.getBoolean(OFFLINE_MODE,
false) or conditionally use BuildConfig.DEBUG (e.g.,
prefManager.getBoolean(OFFLINE_MODE, BuildConfig.DEBUG)) so the true default
only applies in debug/test builds; update the OFFLINE_MODE usage in
GradleBuildService.kt as needed and mention the intended behavior in the commit
message.

set(enabled) {
prefManager.putBoolean(OFFLINE_MODE, enabled)
}
Expand Down
Loading