Skip to content

fix(android): remove unnecessary notification permission request#314

Merged
dishit-wednesday merged 2 commits into
mainfrom
fix/remove-notification-permission
Apr 21, 2026
Merged

fix(android): remove unnecessary notification permission request#314
dishit-wednesday merged 2 commits into
mainfrom
fix/remove-notification-permission

Conversation

@dishit-wednesday

Copy link
Copy Markdown
Collaborator

POST_NOTIFICATIONS was only needed for the foreground service notification. Now that downloads run via WorkManager silently, there are no system notifications to show. Removes the permission from the manifest, the runtime request logic, and all related UI.

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

POST_NOTIFICATIONS was only needed for the foreground service
notification. Now that downloads run via WorkManager silently,
there are no system notifications to show. Removes the permission
from the manifest, the runtime request logic, and all related UI.

Co-authored-by: Dishit <hanmadishit74@gmail.com>

@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 removes the notification rationale feature, including the useNotifRationale hook, its corresponding UI components, and the POST_NOTIFICATIONS permission. It also simplifies the download logic in useModelsScreen by removing the rationale check. Feedback indicates that a development log file was accidentally committed and should be removed. Furthermore, the reviewer suggests updating the tests for download handlers rather than deleting them and simplifying the pass-through useCallback wrappers in useModelsScreen.

Comment thread src/components/ChatMessage/log.txt Outdated
@@ -0,0 +1,688 @@
2026-04-21T05:07:25.740Z] LOG: [ProviderRegistry] Registered provider: local

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

This log file appears to have been committed accidentally. It contains detailed runtime logs from a development session and should be removed from the repository to avoid unnecessary bloat and potential exposure of local environment details.

});
});

describe('handleDownload callback', () => {

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 tests for handleDownload and handleDownloadImageModel were removed entirely. While the rationale logic is gone, these functions still exist in the hook and should have updated tests to verify they correctly invoke the underlying download handlers from useTextModels and useImageModels respectively.

const handleDownload = useCallback(
(...args: Parameters<typeof text.handleDownload>) => {
maybeShowNotifRationale(() => text.handleDownload(...args));
text.handleDownload(...args);

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

This useCallback wrapper is now a simple pass-through to text.handleDownload. To simplify the code and avoid unnecessary re-renders (if the text object is not memoized), consider removing this wrapper and returning text.handleDownload directly from the hook in the return object (line 236).

@codecov

codecov Bot commented Apr 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.83%. Comparing base (d5f50a6) to head (8bad738).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #314      +/-   ##
==========================================
- Coverage   83.86%   83.83%   -0.03%     
==========================================
  Files         224      223       -1     
  Lines       11490    11460      -30     
  Branches     3148     3144       -4     
==========================================
- Hits         9636     9608      -28     
+ Misses       1071     1070       -1     
+ Partials      783      782       -1     
Files with missing lines Coverage Δ
src/screens/ModelsScreen/index.tsx 71.79% <ø> (ø)
src/screens/ModelsScreen/useModelsScreen.ts 88.57% <100.00%> (-0.22%) ⬇️
src/services/backgroundDownloadService.ts 80.40% <ø> (-0.39%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Replace removed notif-rationale test stubs with updated tests that
verify handleDownload and handleDownloadImageModel delegate directly
to their underlying handlers. Delete accidentally committed dev log.

Co-authored-by: Dishit hanmadishit74@gmail.com
@dishit-wednesday dishit-wednesday force-pushed the fix/remove-notification-permission branch from f601cf2 to 8bad738 Compare April 21, 2026 10:12
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@dishit-wednesday dishit-wednesday merged commit 9a0b2b5 into main Apr 21, 2026
4 of 5 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.

1 participant