-
Notifications
You must be signed in to change notification settings - Fork 26
Add sync prefs #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sync prefs #52
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe changes enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant A as Action Trigger
participant SA as ShieldActionExtension
participant SP as System Preferences
A->>SA: handleAction(actionType)
SA->>SA: Log action type
alt if actionType is "whitelistCurrent"
SA->>SA: Log whitelist action triggered
end
SA->>SA: updateBlock(triggeredBy: "shieldAction")
SA->>SP: CFPreferencesAppSynchronize
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
packages/react-native-device-activity/targets/ShieldAction/ShieldActionExtension.swift(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Swift Test (example project)
🔇 Additional comments (3)
packages/react-native-device-activity/targets/ShieldAction/ShieldActionExtension.swift (3)
20-20: Improved logging for better debuggingAdding type information in logs is a good practice for better debugging and troubleshooting. This will make it easier to track action flow through the extension.
139-139: Important improvement to action flowAdding the immediate call to
updateBlockafter saving the whitelist ensures that the block status is updated promptly after the whitelist changes, which improves consistency and reliability.
143-144: Good addition of preference synchronizationThe added synchronization call ensures that preference changes are properly saved and immediately available to other parts of the application. This aligns perfectly with the PR objective to "Add sync prefs" and prevents potential issues where preference changes might not be immediately recognized.
Note that there's already a similar call at line 161 in the other
handleActionfunction, so this addition makes the behavior consistent between both implementations.
| } | ||
|
|
||
| if type == "whitelistCurrent" { | ||
| logger.log("whitelistCurrent!!!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Consider more informative logging message
While adding logging for the whitelistCurrent action is helpful, the current message with multiple exclamation marks could be more informative by including details about what's being whitelisted (app, domain, or category).
-logger.log("whitelistCurrent!!!")
+logger.log("whitelistCurrent action triggered for: app=\(applicationToken != nil), domain=\(webdomainToken != nil), category=\(categoryToken != nil)")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| logger.log("whitelistCurrent!!!") | |
| logger.log("whitelistCurrent action triggered for: app=\(applicationToken != nil), domain=\(webdomainToken != nil), category=\(categoryToken != nil)") |
Summary by CodeRabbit