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

#2648 fix: Invalid recipient delete issue #2650

Merged
merged 9 commits into from
Jan 20, 2025

Conversation

ioanmo226
Copy link
Collaborator

@ioanmo226 ioanmo226 commented Jan 8, 2025

This PR fixed invalid recipient delete issue

close #2648 // if this PR closes an issue


Tests (delete all except exactly one):

  • Does not need tests (refactor only, docs or internal changes)

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities
  • is documented clearly and usefully, or doesn't need documentation

@ioanmo226 ioanmo226 marked this pull request as ready for review January 9, 2025 08:54
@ioanmo226 ioanmo226 requested a review from sosnovsky as a code owner January 9, 2025 08:54
Copy link
Collaborator

@sosnovsky sosnovsky left a comment

Choose a reason for hiding this comment

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

Invalid recipient issue seems to be fixed, but some ui tests from compose group are failing. For example, CheckInvalidEmailRecipient and CheckRecipientPopup.
Can you please check them locally.

To run all compose tests you can use npm run test.mock.compose, or for running specific test - npm run test.mock "check added recipient popup"

@ioanmo226
Copy link
Collaborator Author

Hmm... Let me check

@ioanmo226
Copy link
Collaborator Author

FYI, I’m currently struggling to run UI tests after updating Xcode. I get an error when I run npm run test.mock (or similar commands). I’ve tried everything—manually setting IPHONE_SIMULATOR_ROOT, reinstalling Xcode, reinstalling npm packages, updating packages—but no luck yet. Still digging into it!

ERROR webdriver: unknown error: An unknown server-side error occurred while processing the command. Original error: The IPHONE_SIMULATOR_ROOT environment variable value cannot be retrieved
[0-0] at getErrorFromResponseBody (file:///Users/dev/Desktop/flowcrypt-ios/appium/node_modules/webdriver/build/utils.js:195:12)
[0-0] at NodeJSRequest._request (file:///Users/dev/Desktop/flowcrypt-ios/appium/node_modules/webdriver/build/request/index.js:193:23)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[0-0] at async startWebDriverSession (file:///Users/dev/Desktop/flowcrypt-ios/appium/node_modules/webdriver/build/utils.js:64:20)
[0-0] at async Function.newSession (file:///Users/dev/Desktop/flowcrypt-ios/appium/node_modules/webdriver/build/index.js:19:45)
[0-0] at async remote (file:///Users/dev/Desktop/flowcrypt-ios/appium/node_modules/webdriverio/build/index.js:46:22)
[0-0] at async Runner._startSession (file:///Users/dev/Desktop/flowcrypt-ios/appium/node_modules/@wdio/runner/build/index.js:241:29)
[0-0] at async Runner._initSession (file:///Users/dev/Desktop/flowcrypt-ios/appium/node_modules/@wdio/runner/build/index.js:207:25)
[0-0] at async Runner.run (file:///Users/dev/Desktop/flowcrypt-ios/appium/node_modules/@wdio/runner/build/index.js:88:19)

@sosnovsky
Copy link
Collaborator

Yeah, it's strange, works well for me with the latest Xcode 16.2 and updated Appium.
Did you try to execute xcode-select --install and xcode-select --switch /Applications/Xcode.app?
Also you can try to perform appium driver doctor xcuitest which should show possible configuration errors.

My current configuration is available in https://github.com/FlowCrypt/flowcrypt-ios/tree/ui-tests-ci-fix branch, which I'm trying to fix in Semaphore CI environment.

@ioanmo226
Copy link
Collaborator Author

Yeah, tried above steps but no luck yet.
However appium doctor doesn't show any errors.
Let me try with your configuration.

image

@ioanmo226
Copy link
Collaborator Author

ioanmo226 commented Jan 13, 2025

Hmm... same error with your configuration. (FYI tried to clone, build and run WebDriverAgent as mentioned in your semaphoreci config too)

It's really strange...

@sosnovsky
Copy link
Collaborator

Do you have existing simulator of iPhone SE (3rd generation) with iOS 18.2?

@ioanmo226
Copy link
Collaborator Author

I think current simulator iOS version is 18.2?

@ioanmo226
Copy link
Collaborator Author

Btw I had 17.4, 18.1 and removed all and re-downloaded.
Also tried with 18.1 simulator but still fails.

@sosnovsky
Copy link
Collaborator

I think current simulator iOS version is 18.2?

Yes, latest Xcode 16.2 incudes 18.2 simulator

@ioanmo226
Copy link
Collaborator Author

Yeah, tried on all available versions including 18.2 but no succeed.
Not sure why that error is present even though IPHONE_SIMULATOR_ROOT variable is correctly set.

@sosnovsky
Copy link
Collaborator

can you please also try such commands:

  • xcodebuild -version -sdk iphonesimulator Path - it should return path to simulator SDK (for me it's /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk)
  • get UDID of your simulator by executing xcrun simctl list devices, and then try to fetch IPHONE_SIMULATOR_ROOT for this specific simulator by running xcrun simctl getenv [INSERT_UDID_OF_YOUR_SIMULATOR] IPHONE_SIMULATOR_ROOT. this command is used by appium for getting IPHONE_SIMULATOR_ROOT, maybe it'll return some error message

@ioanmo226
Copy link
Collaborator Author

ioanmo226 commented Jan 13, 2025

xcodebuild -version -sdk iphonesimulator Path returns correct path for me.
However when running xcrun simctl getenv [INSERT_UDID_OF_YOUR_SIMULATOR] IPHONE_SIMULATOR_ROOT, it returns Failed to get AppleVirtualPlatformARMPE service error. (However I think it's not related to appium ui test fail though)
Digging more about this error now.
Thank you

AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Assert: platformExpert, value: 0
AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Failed to get AppleVirtualPlatformARMPE service.
AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Assert: platformExpert, value: 0
AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Failed to get AppleVirtualPlatformARMPE service.

@ioanmo226
Copy link
Collaborator Author

ioanmo226 commented Jan 15, 2025

I dug a bit deeper and here’s what I found. I even reset my Mac and reinstalled Xcode and the simulator, but nothing worked.
It seems this error happens because I’m running macOS in VMware (my original Mac is broken).
As a result, Appium can’t grab the simulator root variable with xcrun simctl getenv [INSERT_UDID_OF_YOUR_SIMULATOR] IPHONE_SIMULATOR_ROOT.

Maybe we should update the Appium code to handle this until Apple fixes the issue. By the way, how did you know Appium uses the xcrun simctl getenv command to get iphone_simulator_root?

https://forums.developer.apple.com/forums/thread/770509

Below is result when running xcrun simctl getenv command though

AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Assert: platformExpert, value: 0
AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Failed to get AppleVirtualPlatformARMPE service.
AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Assert: platformExpert, value: 0
AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Failed to get AppleVirtualPlatformARMPE service.
AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Assert: platformExpert, value: 0
AVPIdentity: AppleVirtualPlatformHostKey.mm:234: Failed to get AppleVirtualPlatformARMPE service.
/Library/Developer/CoreSimulator/Volumes/iOS_22C150/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.2.simruntime/Contents/Resources/RuntimeRoot

PS: Just found where appium tries to get IPHONE_SIMULATOR_ROOT variable.
https://github.com/appium/appium-ios-simulator/blob/5d1a2400a7cc7499eb561c462f301a62bd3f95bd/lib/simulator-xcode-15.js#L18

@ioanmo226
Copy link
Collaborator Author

ioanmo226 commented Jan 15, 2025

I force returned iphone simulator path in appium-ios-simulator _getSystemRoot function and now UI tests start to work.
I know this is temporary and bad solution but for now this might be the only solution.

@ioanmo226
Copy link
Collaborator Author

@sosnovsky In case you missed this PR. this PR typescript fix is blocking other PR typescript tests.

Copy link
Collaborator

@sosnovsky sosnovsky left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, tests pass well now, thanks!

@sosnovsky sosnovsky merged commit 3fc3a23 into master Jan 20, 2025
10 checks passed
@sosnovsky sosnovsky deleted the 2648-cant-delete-invalid-recipient branch January 20, 2025 13:58
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.

Can't delete invalid recipient
2 participants