<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jennifer Rullmann on Medium]]></title>
        <description><![CDATA[Stories by Jennifer Rullmann on Medium]]></description>
        <link>https://medium.com/@jrullmann?source=rss-9c214a695aae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*3Tbkwud04elWXnST.jpg</url>
            <title>Stories by Jennifer Rullmann on Medium</title>
            <link>https://medium.com/@jrullmann?source=rss-9c214a695aae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 03:14:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jrullmann/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Redux Error Reports Concept]]></title>
            <link>https://medium.com/@jrullmann/redux-error-reports-concept-ab85b658f53e?source=rss-9c214a695aae------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab85b658f53e</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jennifer Rullmann]]></dc:creator>
            <pubDate>Sat, 13 Aug 2016 03:26:44 GMT</pubDate>
            <atom:updated>2016-08-13T03:26:44.598Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TLDR: While we could simply dump redux state into generic error monitoring services, we deserve so much more! We need a service tailored for redux. Here’s one imagining of such an app.</strong></p><p><a href="https://medium.com/@jrullmann/debugging-the-production-web-d36373b9440">Debugging front-end web applications in production</a> is hard. In some ways, it’s even harder than back-end services, because the context (and even the existence!) of the error is trapped in the browser.</p><p>Many teams implement logging features that track browser errors and user actions and send them to back-end services that can be queried. <a href="https://rollbar.com/">Rollbar</a>, <a href="https://trackjs.com/">TrackJS</a>, and <a href="https://newrelic.com/">New Relic</a> are examples of hosted services that provide this functionality.</p><p>Most of the efforts to improve web debugging focus on extracting details (mostly so devs can figure out how to reproduce) and correlating events (both to reduce noise and so devs can spot trends and prioritize which to investigate).</p><p>Personally, I don’t <em>really</em> want a tool that makes it easier for me to figure out how to reproduce a bug. I want a tool that figures it out for me. I should <em>never</em> have to ignore a bug just because the user didn’t tell me how to reproduce, or because I don’t enough time for a research project into how the user could have gotten into a buggy state.</p><p>Redux has been a world-changer for me in terms of what’s possible to reproduce and debug an issue. Combine it with <a href="https://github.com/gaearon/redux-devtools">redux-devtools</a> and you get replayable logs of everything the user saw and did. This is huge!!</p><h3>Jen Rullmann on Twitter</h3><p>Imagine - automatic dumping of redux state history on errors, which you can replay on local dev and see exactly what the user saw</p><p>There are efforts underway to dump redux state into error monitoring services — including <a href="https://github.com/netguru/redux-rollbar-middleware">one</a> for Rollbar and <a href="https://github.com/timarney/redux-trackjs-logger">one</a> for TrackJS. But in my opinion, we need so much more than a dump of the state tree. We need a service tailored for redux. Here’s one imagining of such an app.</p><p><strong>The Scene</strong></p><p>In the concept work below, I’m assuming that a problem has occurred in the user’s browser, and that important information has been reported from the browser to a service. The concept shows what a detail view in the redux monitoring tool could look like: an error report.</p><p><strong>History</strong></p><p>While a flat log of errors is a major step up from no logs at all, frequently recurring bugs can quickly become overwhelming. I’m a big believer in looking at every error report; I prefer to get them in my inbox. Let the computer doing the correlating and grouping though, so things only land in my inbox when they are new issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*ugYIS6dNWIQnC6ppocxKfg.png" /></figure><p><strong>Discussion</strong></p><p>Even a team of one can benefit from the ability to enter a note about how an issue was diagnosed and fixed. Later, if a similar issue occurs, the service can correlate the new bug report so the dev can see how the issue was fixed in the past.</p><p>Some teams may also collaborate here, chatting about alternative fixes, sharing prior experiences, or just recording interesting information for a future debugger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*f5vKqR6zArClsO1boscteg.png" /></figure><p><strong>Affected User</strong></p><p>Want to really blow away a user? Send them an email or chat message seconds after they had a bad experience with your application:</p><blockquote>Hi Ted, this is Jen with Awesome-O. I saw that you saw a ‘Could not Save Profile’ error message a few moments ago. I don’t see any issues with the information you entered, and I suspect there’s a problem with the service. I’m going to start looking into this now and will send you an update soon.</blockquote><p>This user is your new best friend. They will love you forever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*5VEnSinWCV_zvxLwhzoq_g.png" /></figure><p><strong>Application Version</strong></p><p>This is pretty standard, with one little treat: the link to your SCM will show you the code <em>at the version that experienced the problem</em>. No reason to make this a guessing game!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*w1V7XgRmWyexQy0qX4FmJQ.png" /></figure><p><strong>Replay State Log</strong></p><p>This is the big one. Click the play button to see the user’s session. Click the expand button to open a link to your application in a new tab. There you can play, rewind, and fast-forward the user actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*ZZ8tDYhlyoALvmBMc4PdiA.png" /></figure><p>The play/rewind/fast-forward looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KFJdTQCHH60QDDWTJobVRw.gif" /><figcaption>Redux Slider Montior (<a href="https://github.com/calesce/redux-slider-monitor">https://github.com/calesce/redux-slider-monitor</a>)</figcaption></figure><p>Because it’s live, you can add breakpoints to your code, or even change it using the browser’s built-in dev tools to try out fixes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*1SQbfCvtfLrzpANzbSNqEQ.gif" /></figure><p><strong>Download State Log</strong></p><p>I get it, trying out fixes in the browser sounds good but you want the full power of your linting tools and transpiling and other goodies.</p><p>NBD, just download the state log and import it locally. Now you can reproduce to your hearts content with all the tools you ❤️.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*2IFb0Axr4LlqjFf4w-zI_A.png" /></figure><p><strong>Console Log</strong></p><p>This is pretty basic — you don’t just want to see the errors that occurred. You want the full stack trace. And line numbers too; I forgot those in the concept art, but they’re important!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*oSrfQe9LBB1o5ocZ_MfTPg.png" /></figure><p><strong>Network Requests</strong></p><p>Often knowing the state in the browser is not enough. You need to know what happened between the browser and the server. Requests, responses, latency… you need everything in your favorite browser’s network tab.</p><p>Add a micro-service back-end architecture and even this isn’t enough information. You need to be able to trace the request to services that call other services that call other services…all the way through.</p><p>In my experience, you’re going to be tracking down this complex service-to-service communications anyway, even if its just far enough to see who on the back-end team you should text to get the fastest turnaround on a bug fix. It is MUCH easier to do this when there are mechanisms like correlation header keys to relate the requests. And if you have that much information, you might as well have a computer correlate the requests all the way to the frond-end requests and show you a pretty chart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*lFdTXPgkK8noFcZGa7Uqtg.png" /><figcaption>Never mind the example data — I just took a random screenshot of the network tab in Safari</figcaption></figure><p><strong>All Together Now</strong></p><p>For me, the key take-away when designing a debugging tool is to ask: what am I really trying to accomplish, and what can or should a computer be able to do for me? Look at the major headaches, like how to reproduce the user’s bug, and solve it with software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*akJdux4OwrqVX7G-VidmdQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab85b658f53e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging the Production Web]]></title>
            <link>https://medium.com/@jrullmann/debugging-the-production-web-d36373b9440?source=rss-9c214a695aae------2</link>
            <guid isPermaLink="false">https://medium.com/p/d36373b9440</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Jennifer Rullmann]]></dc:creator>
            <pubDate>Mon, 25 Jul 2016 19:06:26 GMT</pubDate>
            <atom:updated>2016-07-25T19:06:26.533Z</atom:updated>
            <content:encoded><![CDATA[<p>The ability to diagnose and debug production bugs through the browser is an important skill for any front-end engineer, and one I think will become increasingly important as more teams and projects do continuous deployment. Here’s a couple of ideas to make it easier.</p><h4>Diagnosing Production Bugs</h4><p>When a user reports a bug, they often don’t provide enough context for you to understand what caused the problem. These strategies do not depend on the user to make detailed bug reports.</p><p><strong>Tip #1: Don’t point your local to production</strong></p><p>A lot of developers, especially those who have only worked on small projects, are tempted to point their local environment to the production APIs (or database). This is a very convenient and fast way to diagnose a bug or verify a fix. But it’s difficult to understand the magnitude of changes that are different between the environments. There certainly are <em>some</em> differences, or you’d be able to reproduce locally. Those differences can result in changing production data in ways you don’t intend.</p><p>Like me, I’m sure you’ve seen this go badly, usually in unforeseen ways. Just don’t do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*HCtX7cmDdjVkKmr1faD_xA.gif" /></figure><p><strong>Tip #2: Send logs from the browser to the server</strong></p><p>Logs should be your first strategy when investigating a bug, but the default front-end logging mechanisms provided by the browser don’t send the data to a place you can inspect later.</p><p>Speaking of inspecting later, grepping through text files is painful. Send your logs to a full logging solution, such as <a href="https://www.loggly.com/">loggly</a> or <a href="http://www.splunk.com/">Splunk</a>. They let you do things like click on the user SessionID of the log you’re looking at to find all the logs that were also part of the user’s session. It’s like seeing a story of the user’s experience as they used your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*J6eipRB5WqkkXR2ez5TNWw.gif" /></figure><p><strong>What to Log</strong></p><ul><li>XHR Network Failures</li></ul><p>Most modern web applications load data via XHR. If one of those requests fails — times out or returns a non-success status code — you should be able to correlate that event with a bug report. Nearly all HTTP libraries have a mechanism to inject a failure handler. For example, axios has <a href="https://github.com/mzabriskie/axios#interceptors">interceptors</a>. Use this to send a request to your server with details of the failing request and its response.</p><p>Note that this suggestion is less beneficial for teams that own both the front-end and the API server, as they can easily add server-side logging of non-successful requests. There is still some benefit however: logging of requests that never made it to the API server.</p><ul><li>JavaScript Errors</li></ul><p>Run-time errors of applications are critically important for diagnosing problems — but most are trapped in the user’s browser! Log these errors to the server and enjoy the bug diagnosing experience your back-end dev friends take for granted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*g3JLHWY_VgadDvi4U_eA1w.png" /><figcaption>Don’t worry, you can have run-time errors logged too!</figcaption></figure><ul><li>User Actions</li></ul><p>Sometimes finding the source of an error is not enough, and you need to know what the user did <em>before</em> the problem manifested. You need to know what actions the user took to get the browser into the problematic state.</p><p>Many modern applications track user actions, sending them to an analytics tool like <a href="http://www.google.com/analytics">Google Analytics</a> or <a href="https://mixpanel.com/">Mixpanel</a>. While useful for high-level questions (are people putting things in their shopping cart? What pages has this user visited?), they are not detailed enough for diagnosing bugs. What you need in this situation is a log of every user action and how it changed the model.</p><p>Given idempotent view code and a log of the model, you can figure out exactly what was rendered to the user’s browser. In Production. This is HUGE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*z93nv4DOf-1odSIqkR5upg.gif" /></figure><p>There are a couple of challenges with this technique, mainly centered around the verbosity of user actions. But the possibilities of what can be done with the data is mind-blowing — see Tip #3 in Verifying Fixes in Production for one.</p><p><strong>How to Log</strong></p><p>Here’s the kind of things you want to see in your log:</p><p>{<strong>timestamp</strong>} <strong>Type</strong>: Network exception. <strong>Request</strong>: {url, method, params, body, etc} <strong>Response</strong>: {status code, body, etc} <strong>SessionID</strong>: {unique identifier for this user’s session}</p><p>{<strong>timestamp</strong>} <strong>Type</strong>: Error updating model. <strong>Action</strong>: {description of the update requested and any params}. <strong>Previous state</strong>: {dump of the model before the update was attempted}. <strong>Error</strong>: {the actual JavaScript run-time error thrown by your model code} <strong>SessionID</strong>: {unique identifier for this user’s session}</p><p>{<strong>timestamp</strong>} <strong>Type</strong>: Error updating view. <strong>Props</strong>: {the properties received by the view when it tried to update} <strong>Error</strong>: {the actual JavaScript run-time error thrown by your view code} <strong>SessionID</strong>: {unique identifier for this user’s session}</p><p>{<strong>timestamp</strong>} <strong>Type</strong>: Model updated. <strong>Action</strong>: {description of the update requested and any params}. <strong>SessionID</strong>: {unique identifier for this user’s session}</p><p>Here’s a couple of recommendations to achieve these kinds of logs:</p><ul><li>Make your logging DRY, but tailored to the class of problem encountered. This is much easier to do if you have clean separations of concern (MVC, MVVM, or any other strong pattern) so you can inject a generic error handler per area of concern.</li><li>Prefer idempotent code. If your view code always renders the same HTML provided a set of parameters, then all you need to know is the parameters passed to it to reproduce a problem. There are several libraries and frameworks available today that help you to achieve this. My favorites are <a href="https://facebook.github.io/react/">React</a> and <a href="https://github.com/reactjs/redux">Redux</a>.</li><li>Create a unique session identifier for the user, and include that with any logs sent to the server. Include this SessionID automatically when the user submits a support request, so you can easily find the associated logs. If your backend is micro-service based use the same SessionID in each service’s logs for major bonus points.</li></ul><p><strong>Tip #3: Prettify minified assets</strong></p><p>Your favorite browser will prettify minified assets, adding whitespace so they’re much more readable. This is tremendously helpful when pausing execution on a breakpoint — either manually or having the browser stop on exceptions — so you can inspect the callstack, local state, and function parameters. You can often figure out how to reproduce the issue locally with this simple technique. And since it doesn’t depend on special tools, you can apply this on any computer.</p><p><strong>Tip #4: Tamper with the assets in your browser (danger zone!)</strong></p><p>You can use a proxy server like Fiddler to change the assets requested by your browser. Use this approach to replace minified assets with dev versions, inject more logging, and more.</p><p><strong>Warning</strong>: you can do bad things to production data with this technique. The risk is much lower than pointing your local to production, because the change you introduce is very small. But because this approach uses the production APIs it is possible to do something that you later regret.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*iSEpJkCGyc7OMC0iAwuwyg.gif" /><figcaption>Be very cautious which tampering with production assets</figcaption></figure><h4>Verifying Fixes when You Can Only Reproduce on Production</h4><p>So you’ve diagnosed the issue and you have a potential fix, but you want to test the change. How do you do this if you can only reproduce the issue in production?</p><p><strong>Tip #1: Don’t point your local to production</strong></p><p>See tip #1 in Diagnosing Production Bugs</p><p><strong>Tip #2: Just ship the fix</strong></p><p>If you have a potential fix in mind, but can’t verify except in production, just ship it. Your automated test suite will stop the deploy if you broke something, and if the potential fix doesn’t work, you can always push a revert of the first fix, and try again.</p><p>This is one of the many beautiful things about having an automated test suite that you trust.</p><p><strong>Tip #3: Replay the user’s actions on production in your local</strong></p><p>Given idempotent view code and detailed logs (see Tip #2-User Actions above), you can replay the user’s actions in your own browser and see exactly what the user saw.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KFJdTQCHH60QDDWTJobVRw.gif" /><figcaption><a href="https://github.com/calesce/redux-slider-monitor">SliderMonitor</a> for redux-devtools— play, pause, and rewind user actions.</figcaption></figure><p>First replay the user’s actions on your local to verify that you can reproduce the problem. Then use the full power of your development tools to tweak the code and replay the user’s actions until you can no longer reproduce. I’m so excited about this technique I’m going to drop this again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*z93nv4DOf-1odSIqkR5upg.gif" /></figure><p>The only tool I’m aware of that gives you this powerful feature is <a href="https://github.com/reactjs/redux">Redux</a>. It’s trivial to add middleware that sends every user action and associated params to your server to log. Using <a href="https://medium.com/u/a3a8af6addc1">Dan Abramov</a>’s <a href="https://github.com/gaearon/redux-devtools">redux-devtools</a>, you can later replay these logs from production in your own browser.</p><p>I’m hoping redux-dev tools and monitors continue to mature, as there are a lot of exciting possibilities with its model.</p><p><strong>Tip: #5: Danger zone: Tamper with the loaded assets to inject your fix.</strong></p><p>Using the same approach as Tip #4 in Diagnosing Production Bugs, you can modify the static assets on Production before it reaches your browser.</p><p><strong>Warning</strong>: you can do bad things to production data with this technique. The risk is much lower than pointing your local to production, because the change you introduce is very small. But because this approach uses the production APIs it is possible to do something that you later regret.</p><h4>Summary</h4><p>The tooling available to front-end web developers gets better every year. I think the best is still to come, and that deterministic views will be at the center of it.</p><p>More resources to read:</p><ul><li>Richard Dahlstrom’s <a href="https://raygun.com/blog/2015/06/useful-javascript-debugging-tips-you-didnt-know/">Useful Javascript debugging tips you might not know</a></li><li>Using Fiddler to tamper with assets in <a href="http://www.competa.com/blog/2013/10/how-to-debug-javascript-code-on-a-production-website-without-touching-the-file-on-the-server/">How to debug JavaScript code on a production website, without touching the file on the server</a></li><li>Get to know your browser’s built-in tooling: <a href="https://developer.chrome.com/devtools">Chrome DevTools</a>, <a href="https://developer.apple.com/safari/tools/">Safari Web Development Tools</a>, <a href="https://developer.mozilla.org/en-US/docs/Tools">Firefox Developer Tools</a></li><li><a href="https://medium.com/u/a3a8af6addc1">Dan Abramov</a>’s <a href="https://www.youtube.com/watch?v=xsSnOQynTHs">demo</a> of redux-devtools and <a href="https://medium.com/@dan_abramov">blog</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d36373b9440" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>