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 a bug that fails to create multiple giveaways for the same game in Multiple Giveaway Creator #332

Closed
gizellos opened this issue Dec 24, 2017 · 24 comments
Labels

Comments

@gizellos
Copy link

It happened more times to me. I imported some games, clicked on create and one of the giveaways was red although there was not a problem with it. The giveaway was created successfully and then remade to a vagon. No errors in console.

2017-12-24_110950

@rafaelgomesxyz
Copy link
Owner

This is one of those issues that is very hard to test. What do you mean by "remade to a vagon"?

@gizellos
Copy link
Author

gizellos commented Dec 28, 2017

I meant the process of editing the descriptions to make vagons from the giveaways. It is what you can see in the screenshot.

@rafaelgomesxyz
Copy link
Owner

Has it happened again? How often does it happen?

@gizellos
Copy link
Author

gizellos commented Jan 12, 2018

I have seen it more times. But it is not very often. Maybe once per several hundreds giveaways.

This issue has two parts, though. The first is the main problem - why it is red when it is OK and the second is why there is not written the error. Try to fix the second one and it may help to identify the main problem.

Maybe to put there something like this (it's for PHP just to write it for javascript):

If ($displayed_error_text == "") {
  console.log($error_text)
}

rafaelgomesxyz pushed a commit that referenced this issue Jan 12, 2018
@rafaelgomesxyz
Copy link
Owner

rafaelgomesxyz commented Jan 12, 2018

I just pushed a commit that adds some logging which will make it easier to understand what is going on. Can you install it and check the console once it happens again?

The error appears if the resulting URL after creating a giveaway is "/giveaways/new" because that means the giveaway was not created and returned to the new page. A successful creation would result in a "/giveaway/XXXXX/" URL.

So there is something going on that is making the script detect a "/giveaways/new" URL somehow.

@gizellos
Copy link
Author

OK, I will check it and let you know. Hopefully, it will occur soon.

@rafaelgomesxyz
Copy link
Owner

Any luck?

@gizellos
Copy link
Author

gizellos commented Feb 1, 2018

No luck. It occurs like once per 10 trains so it will take some time.

@rafaelgomesxyz
Copy link
Owner

Closing this to unclutter the issues page. Let me know when/if it happens again.

@gizellos
Copy link
Author

gizellos commented Apr 13, 2018

I just made a long train and I had a lot of the red giveaways. I used shuffle and it is strange that the red giveaways had different position in the train than they were supposed to have. No errors in consoles.

Check the screenshot for more info.

creating gas errors

@gizellos
Copy link
Author

console-log

@rafaelgomesxyz
Copy link
Owner

rafaelgomesxyz commented Apr 13, 2018

Only the red giveaways had different positions? Do you still have the tab open? Can you post all the final positions of the red giveaways if it's not too much trouble? That could somehow be connected.

@gizellos
Copy link
Author

gizellos commented Apr 13, 2018

Yes I still have it open. But sorry, it seems it is not true with the wrong position. In fact it really didn't make the giveaways that were red. I was wrong however I found the real problem.

The problem is that I put there the games twice and it created a giveaway only from one of them. One of the imported giveaways was written as "name-of-game cd-key" and the second "cd-key name-of-game".

So the script instead of making one giveaway with two keys (I had Group adjacent keys for the same game. enabled), it made just one giveaway with one key and the other key ignored and marked it as red.

@rafaelgomesxyz
Copy link
Owner

rafaelgomesxyz commented Apr 13, 2018

Could this be the same case when you first reported the issue?

If so, you might have an unused key for "Chaos and the White Robot", from the image you posted back then:

Was that also supposed to be more copies merged together?

@gizellos
Copy link
Author

gizellos commented Apr 13, 2018

Yes, I think so.

Edit: ESGST feature Search keys found it for me. Without it I would never be able to find it. Nice. :)

@gizellos
Copy link
Author

I think there two problems and both should be fixed:

  1. the script doesn't look for the same games properly to split them if I set it to split the same games to one giveaway. If there are some other games between the same games, the script doesn't recognize it and doesn't split them.

  2. the script has problem with more identical games in the queue.

@rafaelgomesxyz
Copy link
Owner

Wait, there were other games between the same games? Well, there's no issue then. The option is for adjacent keys, which means they must be one after the other.

Portal XXXXX-XXXXX-XXXXX
The Stanley Parable
YYYYY-YYYYY-YYYYY Portal

The above will never create 1 Portal giveaway for 2 copies, regardless of whether the option to group adjacent keys is enabled or not. If you want 1 Portal giveaway for 2 copies they have to be adjacent:

Portal XXXXX-XXXXX-XXXXX
YYYYY-YYYYY-YYYYY Portal
The Stanley Parable

@rafaelgomesxyz
Copy link
Owner

I'll see if I can spot anything that could lead to issue #2, but I think I remember creating multiple giveaways for Portal when I was testing the feature and it never failed to create more giveaways for identical games.

Unfortunately I'm short on giveaway slots, so I can't test it. Perhaps you could test it? If it's not too much trouble to you, of course.

@gizellos
Copy link
Author

Yes, exactly, there were some games between them. I thought the script would recognize it. I think it could work like that, couldn't it? It would be good if it worked like that. Do it please if it is not a problem.

I can test the 2 but I think it is quite sure thing there is the problem because all the red giveaways really was for games that already were there.

Tell me how exactly do you want me to test it and I will do it.

@rafaelgomesxyz
Copy link
Owner

rafaelgomesxyz commented Apr 25, 2018

I added another option to make it work like that (#642).

We still need to figure out why it happens that way. It would be helpful to check the logs (I believe the log you posted before was not for the red giveaway, since that giveaway was actually created). So search for all ocurrences of the game in the console log, not just the first one.

Well, we could start with something small. Like, if you have 2 copies of the same game you could add them to the creator (as 2 separate giveaways) and see if the creation process fails.

@rafaelgomesxyz rafaelgomesxyz changed the title Giveaway creator - successfully created GAs are sometimes red Fix a bug that fails to create multiple giveaways for the same game in Multiple Giveaway Creator Apr 25, 2018
@rafaelgomesxyz rafaelgomesxyz added this to the 7.18.0 milestone Apr 25, 2018
@gizellos
Copy link
Author

gizellos commented May 2, 2018

I just tried to make 3 giveaways where one giveaway was there twice and the other once. Like this:

ABCDE-ABCDE-ABCDE Janken Cards
ABCDE-ABCDE-ABCDE Paddle Battle
ABCDE-ABCDE-ABCDE Janken Cards

I had the option "Group adjacent keys for the same game." enabled and "Create train" disabled.

It created giveaways just for the first two and the third was red.

2018-05-02_174302

2018-05-02_174514

@rafaelgomesxyz
Copy link
Owner

Ah, I had forgotten about this lock. SG has a lock that prevents you from creating 2 separate giveaways for the same game in a time span of 2 minutes.

There was a bug in how ESGST handled that, but now you should see a popup saying "Waiting 2 minutes to create another identical giveaway... Please do not close this popup. If you do not want this waiting period, create a single multiple-copy giveaway for the game." if you try the experiment above again. Then after the 2 minutes all giveaways should be created successfully.

Also, in case you weren't aware, if you click the "Create" button again after some giveaways failed, it will try to re-create those failed giveaways.

@gizellos
Copy link
Author

gizellos commented May 6, 2018

OK but I don't want to wait because mostly, I don't want to make more giveaways for the same games. I put there the games just by accident.

It would be good if the import window could detect that I already imported the same games so that I could cut the game with the key before it is added to the queue.

It could also ask me if I want to add the key to a previously created giveaway.

@rafaelgomesxyz
Copy link
Owner

rafaelgomesxyz commented May 6, 2018

Well, then you can just enable the new option "Group all keys for the same game." (#642). That takes care of everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants