Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

[Error] Issue with order that include "Mittagsangebote" #29

Open
xremix opened this issue Jan 9, 2015 · 17 comments
Open

[Error] Issue with order that include "Mittagsangebote" #29

xremix opened this issue Jan 9, 2015 · 17 comments

Comments

@xremix
Copy link

xremix commented Jan 9, 2015

I couldn't post the order and received the following error:
bildschirmfoto 2015-01-09 um 12 08 18
bildschirmfoto 2015-01-09 um 12 08 26

I also received the same message from pizza.de when trying to edit an order with Mittagsangebote and then the order was empty.

Might be related to #23 ?!

@xremix xremix changed the title Issue with order that include "Mittagsangebote" [Error] Issue with order that include "Mittagsangebote" Jan 9, 2015
@breunigs
Copy link
Owner

breunigs commented Jan 9, 2015

#23 is not related. You’re having problems with what is internally called "replay", i.e. putting every item of each user into a single basket on pizza.de. They’re having problems that the actual submission to pizza.de fails, after the replay is already over.

I’ve recently added a fix for certain order types which produced errors awfully similar to the ones you experience. I think I forgot to update the public instance in pizza.yrden.de, though. Can you share your Basket-ID, so I can have a look?

@breunigs
Copy link
Owner

breunigs commented Jan 9, 2015

(updated the pizza.yrden.de instance)

@xremix
Copy link
Author

xremix commented Jan 11, 2015

Thanks for the quick reply!
The Basler was 'xna', would be nice of you could take a look and if I find time I definitly would try to reproduce it after the Update.

@breunigs
Copy link
Owner

Okay, found it. I think HipsterPizza should/could work around the error message. If you’re going to submit the basket outside of the allowed timeframe, there is little I can do, though.

@breunigs
Copy link
Owner

I just had a look. It works for me as I described above. If the group basket contains a Mittagsmenü and a regular order, the regular order ends up in the basket at the end. The Mittagsmenü is not added though, and HipsterPizza simply says that it could not add that item (as expected) with the Pizza.de error message in the background. I would not remove the pizza.de message, because it gives you insight into why HP couldn’t replay properly.

Did you by any chance try to place your order outside of the allowed times? I accidentally overwrote your original submission time on accident, so I can’t check :/

@xremix
Copy link
Author

xremix commented Jan 12, 2015

I got it working once but now having the issue again (at the same time):

bildschirmfoto 2015-01-12 um 20 32 22
bildschirmfoto 2015-01-12 um 20 32 29

Only "Krupuk" was added this time.

To your question. I can't remember exactly but think I created the basked before the allowed times, but the members added them due the allowed times.

Thanks a lot for your fast reply! And sorry for my bad spelling (wrote from smartphone)

@breunigs
Copy link
Owner

I’m mainly interested in when you tried to replay (“copy order” or “submit basket”), because that’s where/when it fails. Can you share the basket id again, so I can check for sure?

My problem is that I’m not really sure how to debug without actually playing around. I’ll bring my laptop to work tomorrow and see if I can find the issue. If you try to replay tomorrow, can you open your developer console (do you know how?) and copy&paste all the information that is printed there. HipsterPizza is a lot more verbose there.

@breunigs
Copy link
Owner

So, I’ve had a deeper look at how pizza.de decides to show that dialog. I didn’t decipher every little detail, that’d be too much effort. The parts I checked look fine and check that the order is being made in the allowed time block.

You can open your browser’s console on a pizza.de page either directly or via pizza.yrden.de and execute this:

w.T.Vf(224, '09:00', '14:30', '', '')

If it returns false it means you’re currently not in the allowed time. Read on for some more details on this. Maybe play around with it and tell me what time your computer clock displays compared and the console output for above function with different values?

The first parameter is a bitfield of weekdays with the most significant bit set to 1 for some reason. The next two are obviously times (include leading 0, e.g. 9:00 is not valid). No idea what the other two are used for. As of writing, this outputs false because we’re not in that time block. If I modify the times to include the current time it returns true. The range cannot cover midnight (will return false). I assume that’s what some of the parameters I ignored are used for.

I’m definitely going to need more details from you. Please include the console output while ordering and what the above snippet outputs for different times. Also include your computer’s time (or use new Date() in the console and copy that. It will be one hour late due to daylight saving time).

@breunigs
Copy link
Owner

Just replayed your originally mentioned basket. It works fine.

@xremix
Copy link
Author

xremix commented Jan 13, 2015

It seems to work pretty good. I tested it right now at 10 o'clock german time and pizza.de said I can preorder even if the shot is not opened. Here is a screenshot with my date and your code:

bildschirmfoto 2015-01-13 um 10 57 00

I'll try it again out of this date and see what happens. But so far all looks good. If this works (and will work good with our next order) I'll close the issue.

Thanks a lot for your fast replies and good support / explenations.

@xremix
Copy link
Author

xremix commented Jan 16, 2015

Another try, another fail. We tried to order once again (basked ink) but it failed:

bildschirmfoto 2015-01-16 um 11 15 58

@breunigs
Copy link
Owner

for documenting purposes: order sent on 2015-01-16 11:15:10 +0100

@breunigs
Copy link
Owner

were there any warnings from pizza.de? I.e. was there another "Mittagsangebote sind nur von 9-14:30 gültig" or some such?

I’m not really sure what causes this :/

@breunigs
Copy link
Owner

okay, found the issue.

HipsterPizza only loosely follows (read: ignores) caching instructions given from third party providers. This is done to alleviate the fact that every request passes through HipsterPizza.

Pizza.de does an initial time sync with the server, and stores the offset between local and server time… using the cached file. This obviously breaks the timing logic.

breunigs added a commit that referenced this issue Jan 18, 2015
@breunigs
Copy link
Owner

I’ve updated the pizza.yrden.de instance once more. It now includes the fix for the caching and should allow you to make orders as expected.

Please let me know if this fix works for you.

@xremix
Copy link
Author

xremix commented Feb 6, 2015

Sorry for not replying that long. We tried it once again and had that issue again. There was always the warning you described before. Any idea on that?

@breunigs
Copy link
Owner

breunigs commented Feb 6, 2015

You mean the one from pizza.de? I thought I had this fixed with the patch in d8fefce. But apparently not so. I can try to look at this again and hopefully find something, but I'm not really sure what I'm looking for. It also doesn't help that I'm usually at work when I could actually try this for myself, so, yeah :(

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

No branches or pull requests

2 participants