Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ android {
applicationId "ai.offgridmobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1776434971
versionName "0.0.89"
versionCode 1778942469
versionName "0.0.93"
}
signingConfigs {
debug {
Expand Down
4 changes: 2 additions & 2 deletions ios/DownloadManagerModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -906,10 +906,10 @@ extension DownloadManagerModule {
NSLog("[DownloadManager] Polling timer already running, skipping")
return
}
self.pollingTimer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { [weak self] _ in
self.pollingTimer = Timer.scheduledTimer(withTimeInterval: 1.5, repeats: true) { [weak self] _ in
self?.pollProgress()
}
NSLog("[DownloadManager] Polling timer STARTED (0.5s interval)")
NSLog("[DownloadManager] Polling timer STARTED (1.5s interval)")

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.

high

The log message has been updated to reflect a 1.5s interval, but the actual Timer initialization on line 909 still uses 0.5 seconds. This creates a discrepancy where the events are not actually being throttled as intended by the PR description. Please update the withTimeInterval parameter on line 909 to 1.5 to match the log and the intended behavior.

Comment on lines +909 to +912

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.

medium

To improve maintainability and avoid magic numbers, it's a good practice to define the polling interval as a constant. This makes it easier to understand and modify the value in the future, and ensures consistency between the timer interval and the log message.

      let pollingInterval: TimeInterval = 1.5
      self.pollingTimer = Timer.scheduledTimer(withTimeInterval: pollingInterval, repeats: true) { [weak self] _ in
        self?.pollProgress()
      }
      NSLog("[DownloadManager] Polling timer STARTED (%.1fs interval)", pollingInterval)

Comment on lines +909 to +912

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.

medium

The polling interval 1.5 is hardcoded in both the timer initialization and the log message. Defining this as a constant improves maintainability and ensures that updates to the interval are reflected consistently across the module, similar to how DEFAULT_PROGRESS_INTERVAL is used in the Android implementation.

      let interval: TimeInterval = 1.5
      self.pollingTimer = Timer.scheduledTimer(withTimeInterval: interval, repeats: true) { [weak self] _ in
        self?.pollProgress()
      }
      NSLog("[DownloadManager] Polling timer STARTED (\(interval)s interval)")
References
  1. Avoid hardcoding configuration values like polling intervals. Define them as constants for better maintainability and consistency.

}
}

Expand Down
8 changes: 4 additions & 4 deletions ios/OffgridMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1776434971;
CURRENT_PROJECT_VERSION = 1778942469;
DEVELOPMENT_TEAM = C9KXFTGP83;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = OffgridMobile/Info.plist;
Expand All @@ -417,7 +417,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.0.89;
MARKETING_VERSION = 0.0.93;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -438,7 +438,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1776434971;
CURRENT_PROJECT_VERSION = 1778942469;
DEVELOPMENT_TEAM = C9KXFTGP83;
INFOPLIST_FILE = OffgridMobile/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Off Grid - Local AI";
Expand All @@ -448,7 +448,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.0.89;
MARKETING_VERSION = 0.0.93;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "offgrid-mobile",
"version": "0.0.89",
"version": "0.0.93",
"private": true,
"scripts": {
"android": "react-native run-android --mode=debug --appId ai.offgridmobile.dev",
Expand Down
Loading