<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gagandeep Sharma</title>
    <description>The latest articles on DEV Community by Gagandeep Sharma (@gags88).</description>
    <link>https://dev.to/gags88</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3123546%2Fd5887dd8-6350-4b16-a24b-15cbe764f78d.jpg</url>
      <title>DEV Community: Gagandeep Sharma</title>
      <link>https://dev.to/gags88</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gags88"/>
    <language>en</language>
    <item>
      <title>The Most Subtle Bug approved in a PR</title>
      <dc:creator>Gagandeep Sharma</dc:creator>
      <pubDate>Sun, 04 May 2025 21:34:40 +0000</pubDate>
      <link>https://dev.to/gags88/the-most-subtle-bug-approved-in-a-pr-4ake</link>
      <guid>https://dev.to/gags88/the-most-subtle-bug-approved-in-a-pr-4ake</guid>
      <description>&lt;p&gt;✅ Reviewed PR&lt;br&gt;
✅ It passed tests&lt;br&gt;
❌ It quietly broke access for users&lt;/p&gt;

&lt;p&gt;The most subtle bugs aren't in the code you write - they're in the code you approve without enough context.&lt;/p&gt;

&lt;p&gt;This is a short story about a seemingly harmless line in a PR that I reviewed - and how it taught me to slow down, even with small changes.&lt;/p&gt;

&lt;p&gt;The line of code below,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(!user.isVerified) return;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;intention behind this was good not to allow unverified users to proceed into the app.&lt;/p&gt;

&lt;p&gt;But this return statement wasn't part of larger flow. It was inside a route guard - and it exited silently, without a redirect, message or error.&lt;/p&gt;

&lt;h1&gt;
  
  
  🔥 What Happened
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;User who signed up with Google or Github (OAuth) were marked isVerified=false&lt;/li&gt;
&lt;li&gt;This line caused the app to fail to load the protected dashboard, but displayed no error&lt;/li&gt;
&lt;li&gt;The app just failed silently with blank screen to user.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  ✅ The Fix
&lt;/h1&gt;

&lt;p&gt;A fallback route with clear message was added and tested both social and email/password flows going forward.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(!user.isVerified) {
    this.route.navigate(['/verify-email']);
    return;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧠 Real world dev lesson from more than a decade of experience&lt;br&gt;
💬 I'd love to hear your most unexpected regrets too&lt;/p&gt;

</description>
      <category>programming</category>
      <category>angular</category>
      <category>typescript</category>
      <category>react</category>
    </item>
  </channel>
</rss>
