Skip to content

Fix check against app identifier #54

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

Closed
wants to merge 2 commits into from
Closed

Conversation

dalemyers
Copy link
Collaborator

We were checking bundle_id which is com.microsoft.Whatever but should be checking identifier which is a numeric value that Apple generates.

@dalemyers
Copy link
Collaborator Author

@JasperGuo , @Cokile Could one you review this when you get a moment please? Super small PR.

@@ -117,7 +117,7 @@ def get_from_build_number(self, bundle_id: str, build_number: str) -> Build | No
if not app:
break

if app.bundle_id == bundle_id:
if app.identifier == bundle_id:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you help me understand how this would work if app.identifier is a numeric value, while bundle_id is not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right. This was confusing and wrong. I've fixed the other calls so that app identifier is passed in the correct places.

It's always a numeric identifier from what I can see, but Apple always return it as a string, so I've left it as a string in case they make changes in the future.

There's a more interesting problem though. In your code, in testflight.py, you are doing this (snipped):

            app_identifier = state.bundle_id()
            app = self.client.app.get_from_bundle_id(app_identifier)
            self.client.build.upload(ipa_path=ipa_path, platform=asconnect.Platform.IOS, max_attempts=10)
            current_build = self.client.build.wait_for_build_to_process(
                app_identifier, str(self.metadata.build_number)
            )

That app_identifier you pass into wait_for_build_to_process (which in turn calls get_from_build_number) is the bundle ID rather than the Apple specific identifier. Which means you are checking Apple's identifier against the bundle ID, which should never succeed. Except that it does. I don't have your API keys, so I can't confirm what is being returned.

Can you make a call to get_from_build_number with one of your build numbers and see what the app ID is?

Copy link
Contributor

Choose a reason for hiding this comment

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

Will do.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dalemyers Tested with the get_from_build_number, the app ID is a numeric identifier.

For the code in testflight.py, we should have named the variable app_bundle_id instead of app_identifier. Since wait_for_build_to_process (which in turn calls get_from_build_number) accepts bundle id, we just pass the correct value to call the method, though using a confusing variable name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, will check against app identifer instead of bundle id make differences? IIRC, there should not have multile apps with the same bundle id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't believe it should make a difference, however, getting the bundle_id requires parsing the bundle. You don't have to do that if you use the app ID. Makes it easier for users who don't already know their bundle ID.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, this is all wrong. I'm going to close this PR.

@dalemyers dalemyers force-pushed the dalemyers/app_identifier branch from e674f88 to 73939ba Compare April 23, 2025 09:26
@dalemyers dalemyers closed this May 20, 2025
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.

4 participants