This week, my supervisor, Dr. Shawn, reviewed my second pull request. I answered his questions and made the changes he asked for. He approved it on Sunday, and both parts of the Go port are now merged into the main development branch.

Answering Questions About Bulk Orders

At our Monday meeting, Dr. Shawn asked three questions about bulk orders. Does Go send the child orders in one request? Where are they kept? And what happens when a row is bad?

I followed the code from makeOrderMany, which handles one bulk order, to makeChildren, which builds the child orders and sends them to WooCommerce. Go sends the children one at a time and stops at the first error. Before sending, it reads the whole sheet into memory and keeps a full list of child orders. I posted the answers on the pull request with links to the code, so Dr. Shawn could check each one.

Correcting My All-or-Nothing Claim

My pull request description said that if anything goes wrong, Go makes no child orders at all. When Dr. Shawn asked about it, I checked every place where it can fail, and the claim was only partly true. A broken row stops the order before any child is made, because Go checks every row first. But if the shop gives an error halfway through the sending, the children already made stay in the shop, the same as in C++.

I posted a correction, so the review is based on what the code really does. Dr. Shawn then suggested a way to make it truly all-or-nothing. First, every child order is created as “pending payment”, and any error stops the whole bulk order. Once all of them are created, they are changed to “processing”, with retries until each one succeeds. The bulk order then either completes fully or not at all, only a little slower. He asked me to look into whether this can be built.

My lesson is to test a claim against every failure point before I write it down. When I wrote “all-or-nothing”, I was only thinking about mistakes inside the sheet. I forgot that the shop itself can fail while Go is still sending the orders. To check the claim properly, I listed each place where the work can stop, from downloading the sheet to sending each child order, and looked at what is left behind at each one. That list showed the gap clearly, so next time I will make the list first, before I write any claim like this.

Resolving the Review Comments

Dr. Shawn also left three comments in the code, and I resolved all of them. The Go templates now have their own file names, so the C++ and Go versions can share one database. A CMake build now sets the version text on each child order, the same as C++. I also applied his small fix to the bulk order check.

Researching the Participant App UI

I also started on the UI of the participant app, which tells participants when their performance is about to start. This is still the research phase, so I am trying out ideas on a prototype with made-up data. So far, I think a participant only needs three things: their time and venue, the competition information and their result. So the prototype has only two tabs, Today and Schedule. I will try to make sure the app is usable and easy for participants to use.

Next Week’s Plan

Next week, I will work on email retry, a new feature described in a GitHub issue. Right now, each database uses only one email service, so if it fails, the email is not sent again. With this feature, a database can have one or more email services. The database picks one service and uses it for all its emails. When that service fails, the system switches to another one and keeps using it for later emails. The failed email is put in a queue to be sent again, and the reason for the failure is saved.


Categories: Experiential

0 Comments

Leave a Reply

Avatar placeholder

This site uses Akismet to reduce spam. Learn how your comment data is processed.