Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Sparky Fitness mobile app's connectivity and user experience by introducing support for custom proxy headers, which is crucial for users operating behind secure reverse proxies. Alongside this, the mobile app's documentation has been thoroughly updated to guide users through installation, proxy configuration, and troubleshooting. The changes also refine background synchronization permissions on Android for a more robust health data syncing process. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for custom proxy headers in the mobile app, a valuable feature for users behind reverse proxies. The implementation is thorough, covering configuration storage, UI for managing headers, and integration into API requests. The related documentation updates are also clear and helpful.
All identified areas for minor refactoring to improve code maintainability by reducing duplication and enhancing error logging remain valid. My suggestions focus on these aspects. Overall, this is a solid contribution.
| const proxyHeadersJson = await SecureStore.getItemAsync(proxyHeadersSecureStoreKey(entry.id), secureStoreOptions); | ||
| let proxyHeaders: ProxyHeader[] | undefined; | ||
| if (proxyHeadersJson) { | ||
| try { proxyHeaders = JSON.parse(proxyHeadersJson); } catch { /* ignore */ } |
There was a problem hiding this comment.
Silently ignoring a JSON parsing error can make debugging difficult if proxy headers are unexpectedly missing. Consider adding a log here to record the error, which would be helpful for troubleshooting issues with corrupted data in SecureStore.
| try { proxyHeaders = JSON.parse(proxyHeadersJson); } catch { /* ignore */ } | |
| try { proxyHeaders = JSON.parse(proxyHeadersJson); } catch (e) { console.error(`Failed to parse proxy headers for config ${entry.id}:`, e); } |
There was a problem hiding this comment.
got one right! fixed
Tip
Help us review and merge your PR faster!
Please ensure you have completed the Checklist below.
For Frontend changes, please run
pnpm run validateto check for any errors.PRs that include tests and clear screenshots are highly preferred!
Description
Right now users that run Sparky Fitness behind a reverse proxy tunnel such as Cloudflare or Pangolin have to expose all of the /api/* routes, bypassing the added security of these services. This PR adds support for adding custom proxy headers to the requests sent by the app. This is similar to the solution that Immich uses.
I've also added some documentation for the mobile app - App Store, Testflight, google play group links just like the wiki. Plus a section on how to export diagnostic data and how to set up the app to work with custom proxy headers.
Related Issue
PR type [X] Issue [ ] New Feature [ ] Documentation
Linked Issue: #850
Checklist
Please check all that apply:
pnpm run validate(especially for Frontend).en) translation file (if applicable).rls_policies.sqlfor any new user-specific tables.Screenshots (if applicable)
Before
[Insert screenshot/GIF here]
After
[Insert screenshot/GIF here]