Lessons Learned From Troubleshooting a Shopping Cart Issue

Rate this content
Bookmark

Production errors can be tricky, especially when you can’t reproduce them easily or they don't happen very often. In this talk, we’ll go through a case study of a quantity mismatch Shopping Cart issue and what troubleshooting steps we took to solve it. Then drawing from that issue some lessons that we can all learn from as frontend developers.

Hussien Khayoon
Hussien Khayoon
9 min
02 Dec, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk discusses lessons learned from troubleshooting a shopping cart issue in a restaurant marketplace app. The bug was difficult to reproduce but occurred more frequently as the app grew. The investigation involved checking frontend logs and using tools like Sentry and Fullstory. The solution involved using the customer's view at checkout as the source of truth and emphasizing the importance of testing and financial responsibility.

1. Lessons from Troubleshooting Shopping Cart Issue

Short description:

I'm going to talk about lessons learned from troubleshooting a shopping cart issue. Today we're talking about React and working with an ecosystem. I'll share a bug I encountered in a restaurant marketplace app. It had a standard eCommerce flow, but a strange problem occurred.

I'm going to talk about today about lessons learned from troubleshooting a shopping cart issue. So, most of us have used shopping carts. My name's Hussein. I'm a staff dev at Shopify and doing full stack for about 10 years now. React for seven. I've made every possible mistake with React. There's my Twitter there, if you want to give me a follow. Chelsea fan, unfortunately.

Why this talk? So, today we're talking a lot about React. A lot of us use React. We code in React. But the reality is, you always work with an ecosystem. Every time. So, whether it's the browser you're using React on, the web APIs, like you saw a lot of event listeners. You deal with customers, if you take a step back. All of us deal with customers in our code. And we're always having a business domain. Specifically me, I'm in eCommerce now. So, we all deal with those. So, you deal in an ecosystem, it adds complexity to your app, which in turn adds bugs to your app. And today I'm talking about one of those bugs that I had.

Just a brief background about this bug. It wasn't at Shopify, it was at a startup I worked at before in 2019. It was a restaurant marketplace app, built in React and Redux, hundreds of users, millions in GMV, not that big, compared to Shopify, of course. We had about 50 employees, like about 10 to 15 were in tech developers. So, there's a happy path to the app, which is pretty standard in eCommerce. You log in, add items to your cart, provide shipping info, pay, get that money, and then receive your items. Pretty standard, right? Like this is what most eCommerce sites do. So that's what we had. But then we had a very strange problem up here.

2. Troubleshooting Shopping Cart Bug

Short description:

One month or less, a customer would report a bug where they received fewer items than ordered. We checked the order on the back end, server logs, and emails to the supplier. Our data in the database matched everything, so the customer made a mistake. It's important to consider assumptions when troubleshooting bugs.

One month or less, like every once a month or less, a customer would report a specific bug, and they said they received less items than what they actually ordered. So what does that mean? So, the app is kind of like very different now. So I had to do a little bit of screenshot work. So you can see here, five cases of pineapple for example, is what they ordered. So a customer, for example, would say they actually got six or seven cases, not five. Very strange, very bad. So what do we do? In the startup life, we did the same thing any developer would do. Check the order on the back end. Make sure the numbers were correct. Checked our server logs, see if there were any errors, and that the numbers matched up. Check the e-mails that we sent to the supplier, were they a correct number. And what we saw is it turns out our numbers in the database match everything. So we said, customer, you're wrong. Our data is right, too bad. You know what I mean? So you made a mistake, essentially. And that's why it's important to, kind of, talk about our assumptions when we have bugs. So this gives you some context into what we were thinking at the time.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Remix Flat Routes – An Evolution in Routing
Remix Conf Europe 2022Remix Conf Europe 2022
16 min
Remix Flat Routes – An Evolution in Routing
Top Content
This talk introduces the new Flat Routes convention that will most likely be the default in a future version of Remix. It simplifies the existing convention as well as gives you new capabilities.
How to Make a Web Game All by Yourself
JS GameDev Summit 2023JS GameDev Summit 2023
27 min
How to Make a Web Game All by Yourself
It's never been easier to make your own web game, but it's still extremely difficult. What game should you make? Which engine should you choose? Let's discuss how to answer these problems and ways to leverage the unique platform that is the web.
Atomic Deployment for JS Hipsters
DevOps.js Conf 2024DevOps.js Conf 2024
25 min
Atomic Deployment for JS Hipsters
Deploying an app is all but an easy process. You will encounter a lot of glitches and pain points to solve to have it working properly. The worst is: that now that you can deploy your app in production, how can't you also deploy all branches in the project to get access to live previews? And be able to do a fast-revert on-demand?Fortunately, the classic DevOps toolkit has all you need to achieve it without compromising your mental health. By expertly mixing Git, Unix tools, and API calls, and orchestrating all of them with JavaScript, you'll master the secret of safe atomic deployments.No more need to rely on commercial services: become the perfect tool master and netlifize your app right at home!
Your GraphQL Groove
GraphQL Galaxy 2022GraphQL Galaxy 2022
31 min
Your GraphQL Groove
Building with GraphQL for the first time can be anywhere between daunting and easy-peasy. Understanding which features to look for in your client-side and server-side tooling and getting into the right habits (and ridding yourself of old habits) is the key to succeed with a team of any size in GraphQL.

This talk gives an overview of common struggles I've seen numerous teams have when building with GraphQL, how they got around common sources of frustration, and the mindset they eventually adopted, and lessons learned, so you can confidently stick with and adopt GraphQL!
Full-stack & typesafe React (+Native) apps with tRPC.io
React Advanced Conference 2021React Advanced Conference 2021
6 min
Full-stack & typesafe React (+Native) apps with tRPC.io
Top Content
Why are we devs so obsessed with decoupling things that are coupled nature? tRPC is a library that replaces the need for GraphQL or REST for internal APIs. When using it, you simply write backend functions whose input and output shapes are instantly inferred in your frontend without any code generation; making writing API schemas a thing of the past. It's lightweight, not tied to React, HTTP-cacheable, and can be incrementally adopted. In this talk, I'll give a glimpse of the DX you can get from tRPC and how (and why) to get started.
Using UDP in the Browser for faster Client/Server Connections
JS GameDev Summit 2023JS GameDev Summit 2023
21 min
Using UDP in the Browser for faster Client/Server Connections
Top Content

Workshops on related topic

How to create editor experiences your team will love
React Advanced Conference 2021React Advanced Conference 2021
168 min
How to create editor experiences your team will love
Workshop
Lauren Etheridge
Knut Melvær
2 authors
Content is a crucial part of what you build on the web. Modern web technologies brings a lot to the developer experience in terms of building content-driven sites, but how can we improve things for editors and content creators? In this workshop you’ll learn how use Sanity.io to approach structured content modeling, and how to build, iterate, and configure your own CMS to unify data models with efficient and delightful editor experiences. It’s intended for web developers who want to deliver better content experiences for their content teams and clients.