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

Please remove the CocoaPods ping #96

Open
orta opened this issue May 17, 2020 · 17 comments
Open

Please remove the CocoaPods ping #96

orta opened this issue May 17, 2020 · 17 comments

Comments

@orta
Copy link

orta commented May 17, 2020

Hi!

I think people are shipping this check to production devices and have been the cause of downtime on the CocoaPods website quite a few times. Last year I added code specifically to remove your pod from the website: http://cocoapods.org/pods/LLDebugTool

I don't think I can ever remove that code now, but at least you can remove the check to give our servers a chance to be less busy

Screen Shot 2020-05-17 at 8 46 50 AM

@freak4pc
Copy link

freak4pc commented May 17, 2020

Adding the offending code for reference:

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// Check whether has a new LLDebugTool version.
if ([LLConfig shared].autoCheckDebugToolVersion) {
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://cocoapods.org/pods/LLDebugTool"]];
NSURLSessionDataTask *dataTask = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error == nil && data != nil) {
NSString *htmlString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSArray *array = [htmlString componentsSeparatedByString:@"http://cocoadocs.org/docsets/LLDebugTool/"];
if (array.count > 2) {
NSString *str = array[1];
NSArray *array2 = [str componentsSeparatedByString:@"/preview.png"];
if (array2.count >= 2) {
NSString *newVersion = array2[0];
if ([newVersion componentsSeparatedByString:@"."].count == 3) {
if ([[LLDebugTool versionNumber] compare:newVersion] == NSOrderedAscending) {
NSString *message = [NSString stringWithFormat:@"A new version for LLDebugTool is available, New Version : %@, Current Version : %@",newVersion,[LLDebugTool versionNumber]];
[LLTool log:message];
}
}
}
}
}
}];
[dataTask resume];
}
});

The condition is defaulted to YES here:

_autoCheckDebugToolVersion = YES;

@HDB-Li
Copy link
Owner

HDB-Li commented May 27, 2020

You can set autoCheckDebugToolVersion to disable this request. Also this check is actually invalid. I can't get the version number correctly. I will remove it later.

@orta
Copy link
Author

orta commented May 27, 2020

Heh, yeah, I banned your pod page from showing on the CocoaPods website - basically someone shipped your pod to production and we get taken down by their users :D

@HDB-Li
Copy link
Owner

HDB-Li commented May 29, 2020

@orta I see. Thanks, My mistake, I will remove it tonight and release it on next version. 😆

@HDB-Li
Copy link
Owner

HDB-Li commented May 29, 2020

@orta One more question, When I removed this code, Could you cancel banned my pod in future?

I just wanted to push the new version to the user and add a property to turn it off. I don't think my pod has such a large number of users that would cause DDS attacks on Cocoa pods. So maybe cancel banned my pod in future? 😢

@Coeur
Copy link

Coeur commented May 29, 2020

I'm not part of CocoaPods, just a random opinion:
"in the future" could potentially be far away in time depending on the rate of adoption of your new version. So you may better try to get yourself a second pod name (like 'LLDebugTool2' as an example) which doesn't have any release scraping its CocoaPods page, and advertise it around as the replacement of your deprecated pod.

Technically, I believe you can have multiple podspecs files in the same repository, so that both the old pod name and the new one would get updates until a safe version gets largely adopted.

@orta
Copy link
Author

orta commented May 29, 2020

Yeah, I'm open to removing that code but it's at many requests per-second today.

It'll take a long time for developers to update your library, then to update their apps, then for users to update their apps. I have no idea when I can undo it though - perhaps once it starts looking like a request a minute or two.

@HDB-Li
Copy link
Owner

HDB-Li commented May 29, 2020

@orta I see. Thank you for telling me this. I'll fix it as soon as possible

@HDB-Li HDB-Li closed this as completed in d8fa01b May 31, 2020
@HDB-Li
Copy link
Owner

HDB-Li commented May 31, 2020

@orta I'm removed the CocoaPods ping and release a new version, How long will LLDebugTool can be accessed normally in cocoapods?

@HDB-Li HDB-Li reopened this May 31, 2020
@orta
Copy link
Author

orta commented May 31, 2020

months, maybe years - depends on how fast people update really.

@HDB-Li
Copy link
Owner

HDB-Li commented May 31, 2020

So badly..... Does this affect people's ability to search and install my pod through cocoapods?

@HDB-Li
Copy link
Owner

HDB-Li commented May 31, 2020

@orta Is there no other way to solve this problem?

@orta
Copy link
Author

orta commented May 31, 2020

Nope, not really - to give you some perspective: for every 1 normal website page view we get about 20 pings from this code (see the screenshot above)

@Coeur's point that you can re-name your library is honestly one of the best ideas

@HDB-Li
Copy link
Owner

HDB-Li commented Jun 1, 2020

@orta Will this affect when pod install or pod search my pod? Renaming is a very bad idea and the worst way. If it doesn't affect pod install or pod search, the scope of influence should not be particularly large. I can wait until the frequency of this request falls. If pod install or pod search is affected, I will probably need to rename it.

For individual developers, the loss of renaming is too great. 😭

@freak4pc
Copy link

freak4pc commented Jun 1, 2020

I believe the code Orta added only blocks your page on the CocoaPods website and not in trunk so install, etc should work. It’s probably easiest to try for yourself on a blank project :)

@HDB-Li HDB-Li closed this as completed in ad38ad7 Jun 7, 2020
@HDB-Li HDB-Li reopened this Jun 7, 2020
@orta
Copy link
Author

orta commented Jun 8, 2020

Just the web page is blocked, everything else is the same

@HDB-Li
Copy link
Owner

HDB-Li commented Jun 8, 2020

Okey, All I can do is wait.

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

No branches or pull requests

4 participants