Skip to content

throttle ios events#361

Merged
dishit-wednesday merged 1 commit into
mainfrom
throttle-ios-events
May 16, 2026
Merged

throttle ios events#361
dishit-wednesday merged 1 commit into
mainfrom
throttle-ios-events

Conversation

@dishit-wednesday

Copy link
Copy Markdown
Collaborator

change freq from 0.5 s to 1.5s

and upgrade ios and android build files to 0.0.93 version

Summary

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (code change that neither fixes a bug nor adds a feature)
  • Chore (build process, CI, dependency updates, etc.)

Screenshots / Screen Recordings

Android

Before After

iOS

Before After

Checklist

General

  • My code follows the project's coding style and conventions
  • I have performed a self-review of my code
  • I have added/updated comments where the logic isn't self-evident
  • My changes generate no new warnings or errors

Testing

  • I have tested on Android (physical device or emulator)
  • I have tested on iOS (physical device or simulator)
  • I have tested in light mode and dark mode
  • Existing tests pass locally (npm test)
  • I have added tests that prove my fix is effective or my feature works

React Native Specific

  • No new native module without corresponding platform implementation (Android + iOS)
  • New native modules are added to the Xcode project build target (project.pbxproj)
  • No hardcoded pixel values — uses SPACING / TYPOGRAPHY constants from the theme
  • Styles use useThemedStyles pattern (not inline or static StyleSheet.create)
  • Animations/gestures work smoothly on both platforms
  • Large lists use FlatList / FlashList (not .map() inside ScrollView)
  • No unnecessary re-renders introduced (check with React DevTools Profiler if unsure)

Performance & Models

  • Downloads / long-running tasks report progress to the UI
  • File paths are resolved correctly on both platforms (no hardcoded / vs \\)
  • Large files (models, assets) are not committed to the repository

Security

  • No secrets, API keys, or credentials are included in the code
  • User input is validated/sanitized where applicable

Related Issues

Additional Notes

@greptile-apps greptile-apps 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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the application version to 0.0.93 across Android, iOS, and the package configuration, while also modifying iOS project settings related to code signing and build paths. Feedback is provided regarding a discrepancy in the download manager, where the polling timer's log message was updated to 1.5s, but the actual timer interval remains at 0.5s, resulting in a mismatch between the code's behavior and its logging.

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.

change freq from 0.5 s to 1.5s

and upgrade ios and android build files to 0.0.93 version

Co-Authored-By: Dishit Karia <hanmadishit74@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@dishit-wednesday

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the application version to 0.0.93 across Android, iOS, and the package manifest. Additionally, it increases the download progress polling interval in the iOS DownloadManagerModule from 0.5 to 1.5 seconds. Feedback suggests defining this polling interval as a constant to avoid magic numbers and improve maintainability.

Comment on lines +909 to +912
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.

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)

@dishit-wednesday

Copy link
Copy Markdown
Collaborator Author

Fixed — updated withTimeInterval to 1.5 on line 909 to match the log message. The previous push had it reverted to 0.5 by a linter; it's now correctly set to 1.5 in the latest commit. /gemini review

@dishit-wednesday dishit-wednesday merged commit a42cbc0 into main May 16, 2026
7 checks passed

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the application version to 0.0.93 across Android, iOS, and the package configuration. Additionally, the download progress polling interval in the iOS DownloadManagerModule has been increased from 0.5 to 1.5 seconds. Feedback was provided to avoid hardcoding this interval value by defining it as a constant, which would improve maintainability and ensure consistency between the timer logic and the log messages.

Comment on lines +909 to +912
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.

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.

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