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

[spaceship] Remove ensure_csrf in 'delete_provisioning_profile!' for more relability #13258

Merged
merged 2 commits into from
Sep 3, 2018
Merged

Conversation

julianoterres
Copy link
Contributor

@julianoterres julianoterres commented Aug 30, 2018

Fixed error of token of method 'delete_provisioning_profile!' that was returning the message '765: unexpected token at 'Bad Request''

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Description

closes #13256

…s returning the message '765: unexpected token at 'Bad Request''
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@googlebot
Copy link

CLAs look good, thanks!

@julianoterres julianoterres reopened this Aug 30, 2018
@janpio janpio changed the title Fixed error of token of method 'delete_provisioning_profile!' that wa… Fixed error of token of method 'delete_provisioning_profile!' Aug 30, 2018
@julianoterres
Copy link
Contributor Author

The error "765: unexpected token at 'Bad Request" was happening bacause the tokens not was sending in header of the post in the method "delete_provisioning_profile!". I saw that the function "repair_provisioning_profile" there were many people complaining the same error. I analyzed the code and I saw that at function "repair_provisioning_profile" removing this part of code bellow:

ensure_csrf(Spaceship::Portal::ProvisioningProfile) do

and this resolved the problem in "repair_provisioning_profile", then I apply the same fix in "delete_provisioning_profile".

@janpio
Copy link
Member

janpio commented Aug 31, 2018

So this PR replicates what a different PR did as well? Can you link that PR for reference?

@julianoterres
Copy link
Contributor Author

@janpio No, I not have the link the PR that fix the function 'repair_provisioning_profile'.

But I analyze the function 'repair_provisioning_profile' and the unique difference between function 'delete_provisioning_profile' and 'repair_provisioning_profile' was that the function 'delete_provisioning_profile' having this code 'ensure_csrf(Spaceship::Portal::ProvisioningProfile) do' and function 'repair_provisioning_profile' not have this code.

After remove this code from function 'delete_provisioning_profile' I tested and the tokens worked.

@joshdholtz
Copy link
Member

@julianoterres @janpio Here is the PR that removed this from the repair_provisioning_profile - #11381

It looks like Apple has some limit on calls while the CSRF token is valid, even if those calls are made in different "domains." As a result, call to profile.update! will fail in some conditions. See #11162 for details.

It does look like this is a valid fix but I will do some testing on it before giving the 👍 just to make sure 😊

@joshdholtz joshdholtz changed the title Fixed error of token of method 'delete_provisioning_profile!' [spaceship] Fixed error of token of method 'delete_provisioning_profile!' Sep 3, 2018
@joshdholtz joshdholtz changed the title [spaceship] Fixed error of token of method 'delete_provisioning_profile!' [spaceship] Remove ensure_csrf in 'delete_provisioning_profile!' for more relability Sep 3, 2018
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

This looks legit and seems to still work 😊 Thanks for making this fix!

@joshdholtz joshdholtz merged commit 8f27ae5 into fastlane:master Sep 3, 2018
@fastlane-bot
Copy link

Hey @julianoterres 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane-bot
Copy link

Congratulations! 🎉 This was released as part of fastlane 2.103.0 🚀

janpio pushed a commit to janpio/fastlane that referenced this pull request Sep 11, 2018
…more relability (fastlane#13258)

* Fixed error of token of method 'delete_provisioning_profile!' that was returning the message '765: unexpected token at 'Bad Request''

* Removed Trailing whitespace
@fastlane fastlane locked and limited conversation to collaborators Nov 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provisioning Profile Delete Error Token
5 participants