Skip to content
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

Fix events in unity #93

Merged
merged 3 commits into from
Apr 3, 2024
Merged

Fix events in unity #93

merged 3 commits into from
Apr 3, 2024

Conversation

cp-sneha-s
Copy link
Collaborator

@cp-sneha-s cp-sneha-s commented Apr 3, 2024

Purpose

Summary of Changes

Test steps

Conformity

  • Followed git guidelines for creating commit messages and Pull Request guidelines.
  • Self-approved the PR - reviewed the PR as a reviewer and gave it self-approval if everything is ok. If not, made the required changes.
  • Ensured that the PR satisfies all specified requirements in the ticket, including bug fixes and new features.
  • Provided test steps, including steps to reproduce the issue or test the new functionality, ensuring other team members can verify the changes.
  • Added/Updated proper code comments to make it easy-to-understand for other developers.
  • Reused code (if the same code was written twice, made it common and reused it at both places).
  • Removed unused or commented code if not required.
  • Ensured proper Dart naming conventions were used for variables, classes, and methods.
  • Localized user-facing strings.
  • Included screenshots/videos of behavior changes: Provided visual evidence of any changes to UI or behavior for easier review and understanding in the PR description.
  • Implemented proper error handling: Ensured that the code anticipated and handled potential errors and edge cases gracefully.
  • Avoided introducing technical debt: If the PR introduces technical debt, created and linked appropriate tickets for future resolution.
  • Included relevant unit tests: Wrote unit tests that focused on testing behavior and functionality, rather than merely covering lines of code.
  • Ensured code was performant and scalable: Verified that the changes did not introduce performance issues or bottlenecks and could scale as needed.
  • Ensured comments were up-to-date and relevant to the code to describe complex logic and to add understanding for other developers.
  • Marked the PR as ready before submitting it for review.

Visual Evidence (Video, Images or Gif)

Summary by CodeRabbit

  • Refactor
    • Simplified the logic for calculating year difference in date utilities.
  • Bug Fixes
    • Improved error handling in the Sign In process.
  • New Features
    • Enhanced compatibility for the Apple Sign In button across platforms.

Copy link

coderabbitai bot commented Apr 3, 2024

Walkthrough

Recent updates have focused on streamlining iOS deployment processes, refining authentication mechanisms, and enhancing user interface elements. These changes aim to improve provisioning profiles, certificate handling, authentication services, and date calculations while bolstering error handling during the sign-in process. The updates reflect a dedication to backend efficiency and user experience enhancements.

Changes

Files Summary
.github/workflows/ios_deploy.yml Adjusted certificate import options and included a keychain listing command.
ios/Runner.xcodeproj/.../project.pbxproj Updated provisioning profile specifier to "unity-provisioning-profile-03April2024".
ios/Runner/ExportOptions.plist Updated provisioning profile UUID for com.canopas.projectunity.
ios/install_dist_profile.sh Modified provisioning profile decoding and saving using BUILD_PROVISION_PROFILE_BASE64.
lib/data/core/utils/date_formatter.dart Simplified year difference calculation logic.
lib/data/services/auth_service.dart Added 'email' and 'name' scopes to Apple sign-in configuration.
lib/ui/sign_in/bloc/sign_in_view_bloc.dart Improved error handling by adding a catch block in SignInBloc.
lib/ui/sign_in/sign_in_screen.dart Updated rendering logic for AppleSignInButton to check only Platform.isIOS.

Poem

🐇✨
In the realm of code where the digital trees sway,
A rabbit hopped in, bringing updates to play.
"No more errors," it whispered, with a gleam in its eye,
"For I bring improvements, making spirits high."
From deployment to sign-in, it danced through the night,
Leaving behind code that was just right.
🌟🌙

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 07564b2 and 49c37d3.
Files selected for processing (8)
  • .github/workflows/ios_deploy.yml (1 hunks)
  • ios/Runner.xcodeproj/project.pbxproj (1 hunks)
  • ios/Runner/ExportOptions.plist (1 hunks)
  • ios/install_dist_profile.sh (1 hunks)
  • lib/data/core/utils/date_formatter.dart (1 hunks)
  • lib/data/services/auth_service.dart (1 hunks)
  • lib/ui/sign_in/bloc/sign_in_view_bloc.dart (1 hunks)
  • lib/ui/sign_in/sign_in_screen.dart (1 hunks)
Additional comments not posted (6)
ios/Runner/ExportOptions.plist (1)

10-10: Confirm the new provisioning profile UUID 9e32b51b-cdf9-43aa-80fc-e785365ccc9 is correct and matches the provisioning profile in the Apple Developer account.

.github/workflows/ios_deploy.yml (1)

39-41: Ensure the updated certificate import options and the addition of the keychain listing command (security list-keychain) are compatible with your CI/CD environment and do not expose sensitive information in logs.

lib/data/services/auth_service.dart (1)

97-98: Confirm that the added scopes 'email' and 'name' for the Apple sign-in provider are required for your application's functionality and that you have the necessary permissions to request this information from users.

lib/ui/sign_in/sign_in_screen.dart (1)

111-111: Ensure that removing the kIsWeb condition and relying solely on Platform.isIOS for rendering the AppleSignInButton aligns with your application's platform support strategy and does not affect users on other platforms.

lib/data/core/utils/date_formatter.dart (1)

102-104: Ensure the new method calculateDifferenceInYears accurately calculates the year difference, considering leap years and the exact dates, to avoid potential off-by-one errors or inaccuracies.

ios/Runner.xcodeproj/project.pbxproj (1)

604-604: Verify that the updated provisioning profile specifier unity-provisioning-profile-03April2024 is correctly configured in your Xcode project and matches the provisioning profile in the Apple Developer account.

@@ -3,7 +3,7 @@
DIST_PROFILE_FILE=${DIST_PROVISION_UUID}.mobileprovision

# Recreate the certificate from the secure environment variable
echo $DIST_PROVISION | base64 --decode > $DIST_PROFILE_FILE
echo "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode > "$DIST_PROFILE_FILE"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure the decoded provisioning profile is securely handled and that its content is not exposed in logs or error messages.

@@ -3,7 +3,7 @@
DIST_PROFILE_FILE=${DIST_PROVISION_UUID}.mobileprovision

# Recreate the certificate from the secure environment variable
echo $DIST_PROVISION | base64 --decode > $DIST_PROFILE_FILE
echo "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode > "$DIST_PROFILE_FILE"

# copy where Xcode can find it
cp ${DIST_PROFILE_FILE} "$HOME/Library/MobileDevice/Provisioning Profiles/${DIST_PROVISION_UUID}.mobileprovision"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap the variable $HOME in double quotes to prevent globbing and word splitting.

- cp ${DIST_PROFILE_FILE} "$HOME/Library/MobileDevice/Provisioning Profiles/${DIST_PROVISION_UUID}.mobileprovision"
+ cp "${DIST_PROFILE_FILE}" "$HOME/Library/MobileDevice/Provisioning Profiles/${DIST_PROVISION_UUID}.mobileprovision"

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.

Suggested change
cp ${DIST_PROFILE_FILE} "$HOME/Library/MobileDevice/Provisioning Profiles/${DIST_PROVISION_UUID}.mobileprovision"
cp "${DIST_PROFILE_FILE}" "$HOME/Library/MobileDevice/Provisioning Profiles/${DIST_PROVISION_UUID}.mobileprovision"

Comment on lines 3 to 9
DIST_PROFILE_FILE=${DIST_PROVISION_UUID}.mobileprovision

# Recreate the certificate from the secure environment variable
echo $DIST_PROVISION | base64 --decode > $DIST_PROFILE_FILE
echo "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode > "$DIST_PROFILE_FILE"

# copy where Xcode can find it
cp ${DIST_PROFILE_FILE} "$HOME/Library/MobileDevice/Provisioning Profiles/${DIST_PROVISION_UUID}.mobileprovision"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [12-12]

Prefix the glob pattern with ./ to ensure names with dashes are not interpreted as options.

- rm -fr *.mobileprovision
+ rm -fr ./*.mobileprovision

Comment on lines 58 to 59
} on Exception catch(e) {
throw Exception(e);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of re-throwing the caught exception directly, log the error or handle it appropriately to avoid losing the stack trace or context of the original exception.

- throw Exception(e);
+ print("Error during Apple sign-in: $e"); // Consider using a logging framework or handling the error more gracefully.

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.

Suggested change
} on Exception catch(e) {
throw Exception(e);
} on Exception catch(e) {
print("Error during Apple sign-in: $e"); // Consider using a logging framework or handling the error more gracefully.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 49c37d3 and d89175a.
Files selected for processing (3)
  • lib/data/core/utils/date_formatter.dart (1 hunks)
  • lib/ui/sign_in/bloc/sign_in_view_bloc.dart (1 hunks)
  • lib/ui/sign_in/sign_in_screen.dart (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • lib/data/core/utils/date_formatter.dart
  • lib/ui/sign_in/bloc/sign_in_view_bloc.dart
  • lib/ui/sign_in/sign_in_screen.dart

@cp-sneha-s cp-sneha-s merged commit 3493a21 into main Apr 3, 2024
1 check passed
@cp-sneha-s cp-sneha-s deleted the fix-console-error branch April 3, 2024 07:15
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