<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bits of .NET</title>
	<atom:link href="http://blog.ercanopak.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ercanopak.com</link>
	<description>Daily micro-tips for C#, SQL, performance, and scalable backend engineering.</description>
	<lastBuildDate>Sun, 04 Oct 2026 11:32:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>http://blog.ercanopak.com/wp-content/uploads/2018/06/cropped-EO_LOGO_32-32x32.png</url>
	<title>Bits of .NET</title>
	<link>http://blog.ercanopak.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>CSS: Fix a prefers-color-scheme Media Query That Gets Silently Overridden by a Browser Extension&#8217;s Forced Dark Mode</title>
		<link>http://blog.ercanopak.com/css-fix-a-prefers-color-scheme-media-query-that-gets-silently-overridden-by-a-browser-extensions-forced-dark-mode/</link>
					<comments>http://blog.ercanopak.com/css-fix-a-prefers-color-scheme-media-query-that-gets-silently-overridden-by-a-browser-extensions-forced-dark-mode/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:32:18 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Browser Extensions]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Dark Mode]]></category>
		<category><![CDATA[prefers-color-scheme]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/css-fix-a-prefers-color-scheme-media-query-that-gets-silently-overridden-by-a-browser-extensions-forced-dark-mode/</guid>

					<description><![CDATA[🎨 The Dark Mode Query That Wasn&#8217;t the Only One Running A prefers-color-scheme media query reads the operating system&#8217;s reported color scheme preference and switches a site&#8217;s own styles accordingly, which works correctly and predictably as long as the only thing deciding how the page looks is the page&#8217;s own stylesheet. A browser extension that [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #0f2027 0%, #203a43 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3a8.png" alt="🎨" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Dark Mode Query That Wasn&#8217;t the Only One Running</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>A prefers-color-scheme media query reads the operating system&#8217;s reported color scheme preference and switches a site&#8217;s own styles accordingly, which works correctly and predictably as long as the only thing deciding how the page looks is the page&#8217;s own stylesheet. A browser extension that forces a dark appearance onto every site by rewriting computed colors after the page renders operates at a completely different layer, applied after your stylesheet has already done its job, and the two systems can disagree without either one reporting an error &#8211; the media query correctly detects a light-mode system preference and renders light-mode styles, while the extension still forces a dark overlay on top of them a moment later, producing a combination of colors neither the page nor the extension ever actually intended together.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="css">@media (prefers-color-scheme: dark) {
  body { background: #121212; color: #eaeaea; }
  .card { background: #1e1e1e; border-color: #333; }
}

@media (prefers-color-scheme: light) {
  body { background: #ffffff; color: #1a1a1a; }
  .card { background: #f5f5f5; border-color: #ddd; }
}

/* This correctly renders the light-mode rules when the OS reports
   a light preference - the media query itself is not wrong. A
   browser extension with forced dark mode enabled then rewrites
   the computed background and text colors AFTER layout, on top
   of the already-correct light styles, producing a page where a
   light-styled .card sits on a forced-dark body, with image and
   icon contrast tuned for one scheme sitting on a background from
   the other - a combination this stylesheet never had to account
   for, because it assumes only one system is deciding the colors. */</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix: Don&#8217;t Assume Your Media Query Is the Only Thing Deciding Colors</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Reproduce the issue by actually enabling a forced-dark-mode browser extension during testing, rather than relying solely on the operating system&#8217;s own light/dark toggle, since that toggle alone never exercises the extension layer at all.</li>
<li>Set an explicit color-scheme meta value or CSS property declaring which schemes the page actually supports, which gives some forced-dark extensions a stronger signal to respect the page&#8217;s own styling instead of overriding it uniformly.</li>
<li>Avoid relying on an image, icon, or illustration whose contrast was tuned for only one color scheme, and prefer styling approaches &#8211; a background shorthand instead of separate layered properties, for instance &#8211; that degrade more predictably if something outside the page&#8217;s own stylesheet later adjusts individual color values.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>The media query itself is implemented correctly and passes every test that checks the operating system&#8217;s own preference toggle, so there is nothing in the stylesheet&#8217;s logic to suggest the final rendered result depends on anything beyond that one setting.</li>
<li>A forced-dark-mode extension is specific to whichever browser and configuration an individual visitor happens to be running, so the mismatched colors only appear for a subset of visitors and never show up in a design review done on a clean, extension-free browser.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>A color-scheme media query answers one question correctly &#8211; what did the operating system report &#8211; and has no say at all over what happens to the colors after that answer leaves its hands.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— UI Engineer</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/css-fix-a-prefers-color-scheme-media-query-that-gets-silently-overridden-by-a-browser-extensions-forced-dark-mode/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git: Fix a Merge Commit That Silently Drops a File Because Both Branches Deleted It Differently</title>
		<link>http://blog.ercanopak.com/git-fix-a-merge-commit-that-silently-drops-a-file-because-both-branches-deleted-it-differently/</link>
					<comments>http://blog.ercanopak.com/git-fix-a-merge-commit-that-silently-drops-a-file-because-both-branches-deleted-it-differently/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:32:12 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[branching]]></category>
		<category><![CDATA[Version Control]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/git-fix-a-merge-commit-that-silently-drops-a-file-because-both-branches-deleted-it-differently/</guid>

					<description><![CDATA[🔀 The File Two Branches Both Agreed to Lose Git&#8217;s three-way merge treats a file as cleanly resolved, with no conflict markers and no manual intervention needed, whenever both sides of the merge agree on the outcome for that file &#8211; and two branches that each independently deleted the same file, for entirely different and [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #0f2027 0%, #203a43 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f500.png" alt="🔀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The File Two Branches Both Agreed to Lose</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>Git&#8217;s three-way merge treats a file as cleanly resolved, with no conflict markers and no manual intervention needed, whenever both sides of the merge agree on the outcome for that file &#8211; and two branches that each independently deleted the same file, for entirely different and unrelated reasons, count as agreeing as far as the merge algorithm is concerned. One branch might have deleted a configuration file because it was replaced by a new settings system, while an unrelated branch deleted the same file because it moved into a different folder under a new name &#8211; the merge sees two deletions of the same path and completes without a single conflict, even though the second branch actually still needed that file to exist, just somewhere else.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="text">$ git log --oneline --graph --all
*   a1b2c3d (HEAD -&gt; main) Merge branch 'rename-config'
|\
| * d4e5f6a (rename-config) Move legacy.config to config/app.config
* | 9f8e7d6 (remove-dead-code) Delete legacy.config (dead feature)
|/
* 1234567 Base commit with legacy.config present

$ git show a1b2c3d --stat
# No conflict was ever reported during this merge - 'legacy.config'
# simply disappears from the tree, because both branches agree it
# should no longer exist at that path. The rename-config branch's
# actual intent - that the FILE still exists, under config/app.config
# - is invisible to a merge algorithm that only ever compares paths,
# never file content moved to a new location.

$ git show a1b2c3d -- config/app.config
# fatal: path 'config/app.config' does not exist in 'a1b2c3d' either -
# the rename branch's new file was never actually merged in, because
# it lived on a commit this merge's history graph never touched.</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix: Treat a Clean Merge as a Starting Point, Not Proof of Correctness</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Diff the merge commit against each of its two parents individually right after merging, specifically looking for any file that disappears relative to one parent, since a clean merge&#8217;s absence of conflict markers never checks for this kind of cross-branch rename.</li>
<li>Use a rename-detection-aware diff, or review the actual commit history of a deleted file on each branch, before merging two long-lived branches that both touched the same area of the codebase, so an intentional rename on one side is caught before the merge silently erases it.</li>
<li>Run the test suite, and specifically any test that loads configuration or data from a file path, immediately after a merge that touched shared infrastructure files, rather than trusting a conflict-free merge to mean every file ended up where it needed to be.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>A merge with zero conflicts reads as the safe, boring outcome &#8211; the kind every developer wants to see &#8211; so there is no natural prompt to go back and double-check individual files once the merge command itself reports success with nothing to resolve.</li>
<li>The missing file only causes a visible failure once something tries to load it at runtime, which can be long after the merge itself, especially if the file is only read in a code path or environment that isn&#8217;t exercised by routine local testing.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>Git calls a merge clean when both branches agree &#8211; it never asks whether what they agree on is actually what either branch meant.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— Version Control Tip</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/git-fix-a-merge-commit-that-silently-drops-a-file-because-both-branches-deleted-it-differently/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>HTML5: Fix a Native Lazy-Loading Image That Never Loads Because It Sits Inside a Hidden Tab Until the User Clicks It</title>
		<link>http://blog.ercanopak.com/html5-fix-a-native-lazy-loading-image-that-never-loads-because-it-sits-inside-a-hidden-tab-until-the-user-clicks-it/</link>
					<comments>http://blog.ercanopak.com/html5-fix-a-native-lazy-loading-image-that-never-loads-because-it-sits-inside-a-hidden-tab-until-the-user-clicks-it/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:32:06 +0000</pubDate>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[Lazy Loading]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/html5-fix-a-native-lazy-loading-image-that-never-loads-because-it-sits-inside-a-hidden-tab-until-the-user-clicks-it/</guid>

					<description><![CDATA[🧩 The Image That Was Lazy Forever Native lazy loading decides whether to fetch an image based on its position relative to the viewport, which works well for images further down a normally visible page &#8211; but an image placed inside a tab panel, an accordion section, or any other container hidden with a display-none [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #2c3e50 0%, #4a6076 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f9e9.png" alt="🧩" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Image That Was Lazy Forever</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>Native lazy loading decides whether to fetch an image based on its position relative to the viewport, which works well for images further down a normally visible page &#8211; but an image placed inside a tab panel, an accordion section, or any other container hidden with a display-none style has no meaningful viewport position at all while it stays hidden, and the browser can simply never decide the image is close enough to load. The moment the user actually clicks the tab and the container becomes visible, the image&#8217;s layout position is recalculated, but by then the lazy-loading decision has already been made and missed, leaving a blank space where the image should be until the user scrolls in a way that happens to retrigger the check.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;div class="tab-panel" id="specs" style="display: none;"&gt;
  &lt;!-- Hidden by display:none until the user clicks the "Specs" tab --&gt;
  &lt;img src="diagram.png" loading="lazy" alt="Product diagram"&gt;
&lt;/div&gt;

&lt;script&gt;
  tabButton.addEventListener('click', () =&gt; {
    specsPanel.style.display = 'block';
    // The image's loading="lazy" decision was already evaluated
    // while display:none meant it had no real position on the
    // page at all - some browsers simply never revisit that
    // decision once the element becomes visible later, leaving
    // the image unloaded even though it is now clearly on screen.
  });
&lt;/script&gt;</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix: Don&#8217;t Ask Lazy Loading to Judge an Element With No Position</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Switch the image&#8217;s loading attribute from lazy to eager for any image inside a tab, accordion, or other initially hidden container, since the performance benefit of lazy loading assumes a real scroll position to measure against in the first place.</li>
<li>Trigger the browser to re-evaluate the image, such as by briefly toggling the src attribute or forcing a reflow, at the exact moment the containing tab or panel becomes visible, if keeping lazy loading on that image is still worth the extra handling.</li>
<li>Use a visibility-based loading approach built specifically for this case &#8211; loading the image the moment its container&#8217;s hidden state changes &#8211; rather than relying on the browser&#8217;s own viewport-distance heuristic to somehow account for content it currently cannot see at all.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Lazy loading behaves exactly as expected for every image lower down a normal, fully visible page, so there is nothing to suggest it needs different treatment for an image that starts out hidden in a tab rather than merely off-screen below the fold.</li>
<li>The blank space where the image should be often gets attributed to a slow network or a broken image path, since nothing in the browser&#8217;s behavior visibly announces that a loading decision was made and simply never revisited once the tab opened.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>Lazy loading decides based on where an element is on the page &#8211; an element with display:none isn&#8217;t anywhere on the page yet, and that decision never gets a second chance.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— Frontend Architect</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/html5-fix-a-native-lazy-loading-image-that-never-loads-because-it-sits-inside-a-hidden-tab-until-the-user-clicks-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The AI Prompt That Traces a Null Reference Exception Back to the Exact Line That First Produced the Null</title>
		<link>http://blog.ercanopak.com/the-ai-prompt-that-traces-a-null-reference-exception-back-to-the-exact-line-that-first-produced-the-null/</link>
					<comments>http://blog.ercanopak.com/the-ai-prompt-that-traces-a-null-reference-exception-back-to-the-exact-line-that-first-produced-the-null/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:32:01 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Null Reference]]></category>
		<category><![CDATA[Prompt Engineering]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/the-ai-prompt-that-traces-a-null-reference-exception-back-to-the-exact-line-that-first-produced-the-null/</guid>

					<description><![CDATA[🤖 The Prompt That Asks Where the Null Actually Came From A null reference exception&#8217;s stack trace reliably shows where a null value was finally used in a way that crashed &#8211; a method call, a property access, a dereference &#8211; but it says nothing at all about where that value became null in the [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #0f2027 0%, #203a43 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f916.png" alt="🤖" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Prompt That Asks Where the Null Actually Came From</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>A null reference exception&#8217;s stack trace reliably shows where a null value was finally used in a way that crashed &#8211; a method call, a property access, a dereference &#8211; but it says nothing at all about where that value became null in the first place, and the two locations are very often in completely different parts of the codebase. Tracing backward from the crash site through every assignment, parameter pass, and return value that could have produced the null is exactly the kind of mechanical, multi-step backward walk an AI prompt can perform quickly across a pasted call chain, rather than the developer manually jumping between a dozen files guessing which one actually introduced the gap.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="text">You are tracing a null reference exception back to its actual
source, not just describing where it crashed. I'll paste the stack
trace and the relevant methods along the call chain it passed
through. Please:

1. Identify the exact variable or expression that was null at the
   crash site, from the stack trace and the crashing line.
2. Walk backward through the call chain I've provided: for each
   method in the trace, find where that same value was assigned,
   returned, or passed in, and determine whether IT could have
   been null at that point too.
3. Keep walking backward until you reach the first point in the
   provided code where the value was assigned from something that
   can plausibly return or produce null - a lookup that can miss, an
   external call, a optional field - rather than stopping at the
   first assignment you see.
4. State clearly which single line is the most likely original
   source of the null, and what specifically about that line can
   produce a null value.

Stack trace and relevant code:

[paste your stack trace and methods here]</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Prompt Works</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Explicitly separating the crash site from the source forces the walk backward through the call chain instead of stopping at the first and most visible line, which is usually just where the null finally got used, not where it was created.</li>
<li>Asking the model to keep walking until it reaches a plausibly null-producing operation &#8211; a lookup, an external call, an optional value &#8211; gives it a concrete stopping condition, instead of guessing arbitrarily how far back in the chain to look.</li>
<li>Requesting the single most likely source line, rather than a list of every place null theoretically could have come from, produces one specific, checkable hypothesis to go verify first instead of a broad list that still requires manual triage.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Paste every method the stack trace actually passes through, not just the one where the exception was thrown, since the backward walk this prompt performs can only go as far back as the code you actually provide.</li>
<li>Treat the identified source line as the most likely explanation to verify with a debugger or a log statement next, not as a confirmed root cause &#8211; the model is reasoning from the code&#8217;s logic, not from an actual runtime trace of that specific failure.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>A stack trace tells you where a null finally broke something &#8211; it was never going to tell you where that null was actually born, because that already happened, earlier, somewhere else.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— AI Power User</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/the-ai-prompt-that-traces-a-null-reference-exception-back-to-the-exact-line-that-first-produced-the-null/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The AI Prompt That Turns a Gym Membership Contract&#8217;s Fine Print Into a Plain-English List of Cancellation Steps</title>
		<link>http://blog.ercanopak.com/the-ai-prompt-that-turns-a-gym-membership-contracts-fine-print-into-a-plain-english-list-of-cancellation-steps/</link>
					<comments>http://blog.ercanopak.com/the-ai-prompt-that-turns-a-gym-membership-contracts-fine-print-into-a-plain-english-list-of-cancellation-steps/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:31:56 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Contracts]]></category>
		<category><![CDATA[Personal Finance]]></category>
		<category><![CDATA[Prompt Engineering]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/the-ai-prompt-that-turns-a-gym-membership-contracts-fine-print-into-a-plain-english-list-of-cancellation-steps/</guid>

					<description><![CDATA[🤖 The Prompt That Reads the Fine Print Before You Need It A gym membership contract&#8217;s cancellation terms are usually buried a few pages in, written in the same dense legal phrasing as the rest of the agreement, and structured around conditions that only matter once you actually want out &#8211; a required notice period, [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f916.png" alt="🤖" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Prompt That Reads the Fine Print Before You Need It</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>A gym membership contract&#8217;s cancellation terms are usually buried a few pages in, written in the same dense legal phrasing as the rest of the agreement, and structured around conditions that only matter once you actually want out &#8211; a required notice period, a specific channel the cancellation request has to go through, a fee that applies inside some window but not outside it. Reading the whole contract to extract just the cancellation path is tedious enough that most people skip it entirely until the day they actually want to cancel, which is exactly the day a missed notice period or the wrong submission channel costs them an extra month or a fee they could have avoided by knowing the actual steps in advance.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="text">Here's a photo/scan of my gym membership contract. Please read
through it and pull out everything specifically related to
canceling the membership, organized as:

1. The exact notice period required before cancellation takes
   effect (for example, "30 days before your next billing date"),
   stated in plain terms with the specific number of days.
2. The required method of cancellation - in writing, in person,
   through a specific online form, certified mail, or anything
   else the contract specifies - and flag clearly if a method that
   seems reasonable (like a phone call or an email) is NOT actually
   accepted according to the contract's own wording.
3. Any fee that applies to cancellation, and under what specific
   condition it does or doesn't apply (an early-termination fee
   inside a minimum commitment period, for example, versus no fee
   once that period has passed).
4. Any auto-renewal clause, and the specific date or window before
   which I'd need to act to stop the next renewal from happening.

Summarize it as a short numbered checklist I could actually follow,
in the order I'd need to do things, with the specific dates or
deadlines spelled out rather than just described in relative terms.</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Prompt Works</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Asking specifically whether an easy, obvious-seeming cancellation method is actually NOT accepted catches the single most common and costly mistake &#8211; assuming a phone call or an email counts as proper cancellation when the contract requires something more formal.</li>
<li>Requesting the notice period stated with a specific number of days, rather than left as the contract&#8217;s own relative phrasing, turns a clause that requires mental math against your own billing date into a deadline you can act on directly.</li>
<li>Asking for the result as an ordered checklist, rather than a summary of what the contract says, turns legal text into something you can actually act on the day you decide to cancel, instead of information you would have to re-read and re-interpret again at that point.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Provide the complete contract, including any pages that look like they are just boilerplate or signatures, since a cancellation clause or fee schedule is sometimes placed in an appendix or a separate addendum rather than the main body of the agreement.</li>
<li>Treat the extracted checklist as a strong starting point to act on, not a substitute for confirming with the gym directly if anything in the contract&#8217;s wording feels ambiguous &#8211; some contracts leave real room for interpretation that only the business itself can resolve.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>The cancellation terms were always in the contract you signed &#8211; the only thing standing between you and following them was ever just the time it takes to actually read that far.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— AI Power User</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/the-ai-prompt-that-turns-a-gym-membership-contracts-fine-print-into-a-plain-english-list-of-cancellation-steps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Photoshop: Fix a Color Profile Mismatch That Makes Printed Output Look Nothing Like What You Saw On Screen</title>
		<link>http://blog.ercanopak.com/photoshop-fix-a-color-profile-mismatch-that-makes-printed-output-look-nothing-like-what-you-saw-on-screen/</link>
					<comments>http://blog.ercanopak.com/photoshop-fix-a-color-profile-mismatch-that-makes-printed-output-look-nothing-like-what-you-saw-on-screen/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:31:51 +0000</pubDate>
				<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Color Management]]></category>
		<category><![CDATA[Color Profiles]]></category>
		<category><![CDATA[Printing]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/photoshop-fix-a-color-profile-mismatch-that-makes-printed-output-look-nothing-like-what-you-saw-on-screen/</guid>

					<description><![CDATA[🖌️ The Print That Looked Like a Different Photo Entirely A monitor displays color using its own calibration and the document&#8217;s assigned color profile, converted on the fly for your specific screen, which is why an image can look vivid and accurate while you edit it &#8211; but sending that same document to a printer [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #2c3e50 0%, #4a6076 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f58c.png" alt="🖌" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Print That Looked Like a Different Photo Entirely</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>A monitor displays color using its own calibration and the document&#8217;s assigned color profile, converted on the fly for your specific screen, which is why an image can look vivid and accurate while you edit it &#8211; but sending that same document to a printer involves an entirely separate conversion, from the document&#8217;s working color space into whatever profile the printer or print service actually uses, and that conversion is where a document edited without a clear, deliberate profile strategy can produce colors far outside what either side intended. A wide-gamut working space that displays beautifully on a wide-gamut monitor can contain colors a standard printer profile simply cannot reproduce at all, and without a proper soft-proofing step before sending the file, there is no warning that the conversion is about to clip or shift those colors until the physical print comes back looking wrong.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="text">Setup: a photo edited and color-graded on a wide-gamut monitor,
saved with the document's working space set to a wide-gamut profile
because that's what the camera's raw file was imported with and
nothing was deliberately changed afterward.

1. On-screen, deep saturated reds and greens in the photo look
   accurate and vivid - the monitor can actually display most of
   that wide-gamut range.
2. File sent directly to a commercial print service with no
   soft-proofing step and no explicit profile conversion performed
   first - "it looks right here, so it should print right."
3. Printed copy comes back with the same reds and greens rendered
   as flat, muddy, and noticeably different from what was visible
   on screen throughout editing.

What's actually happening: the printer's actual color profile
covers a narrower range of reproducible colors than the wide-gamut
working space the document was edited in. Every color outside the
printer's range gets silently converted to the nearest reproducible
color during the print pipeline's own conversion step - a step that
happened with no preview, no warning, and no choice offered over
exactly how that out-of-range color should be handled.</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix: Soft-Proof and Convert Deliberately Before You Ever Print</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Use Soft Proof with the printer&#8217;s or print service&#8217;s actual ICC profile loaded before sending any file for printing, specifically to see on screen, in advance, exactly which colors the print process will have to compress or shift during its own conversion.</li>
<li>Convert the document to the target printer profile explicitly, choosing the rendering intent deliberately, rather than leaving the working space as wide-gamut and letting whatever conversion the print service&#8217;s own pipeline performs make that decision for you with no visibility into the result.</li>
<li>Ask any commercial print service directly which ICC profile they actually use and whether they expect a file already converted to it, or a file left in its original working space for them to convert &#8211; the two workflows produce different results, and assuming the wrong one is a common, avoidable mismatch.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>A wide-gamut monitor makes an image genuinely look accurate and well-saturated throughout the entire editing process, with nothing in that on-screen experience hinting that a meaningful share of those colors sit outside what a standard printer can ever physically reproduce.</li>
<li>The conversion from the document&#8217;s working space to the printer&#8217;s profile happens automatically, as an invisible step inside the print pipeline, with no dialog or preview offered unless soft-proofing is deliberately turned on beforehand &#8211; by default, there is simply no warning at all.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>Your monitor shows you what your document&#8217;s colors are &#8211; it never promised that&#8217;s what a printer, with a narrower set of colors to work with, can actually put on paper.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— Creative Pro</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/photoshop-fix-a-color-profile-mismatch-that-makes-printed-output-look-nothing-like-what-you-saw-on-screen/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress: Fix Search Results That Return Pages From a Theme You Deactivated Months Ago</title>
		<link>http://blog.ercanopak.com/wordpress-fix-search-results-that-return-pages-from-a-theme-you-deactivated-months-ago/</link>
					<comments>http://blog.ercanopak.com/wordpress-fix-search-results-that-return-pages-from-a-theme-you-deactivated-months-ago/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:31:45 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Custom Post Types]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[themes]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/wordpress-fix-search-results-that-return-pages-from-a-theme-you-deactivated-months-ago/</guid>

					<description><![CDATA[📝 The Search Results Still Haunted by an Old Theme WordPress&#8217;s built-in search queries the posts table directly and has no awareness of which theme happens to be active, which is exactly why switching themes normally has no effect on search results at all &#8211; but a page builder or a theme-specific plugin that registered [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4dd.png" alt="📝" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Search Results Still Haunted by an Old Theme</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>WordPress&#8217;s built-in search queries the posts table directly and has no awareness of which theme happens to be active, which is exactly why switching themes normally has no effect on search results at all &#8211; but a page builder or a theme-specific plugin that registered its own custom post type to store landing pages, templates, or saved layouts can leave those entries sitting in the database indefinitely, long after the theme that created and depended on them has been deactivated and replaced. Those old entries still match a search query by title or content just like any other post, and clicking through to one produces a broken or half-rendered page, because the shortcodes or template logic that knew how to actually display that content left along with the old theme and its companion plugin.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="text">Symptom:
1. Theme switched from "BuilderTheme Pro" to a new theme six months
   ago; the BuilderTheme Pro companion plugin was deactivated and
   deleted at the same time.
2. Site search for "pricing" returns a result titled "Pricing -
   Builder Layout" dated from over a year ago.
3. Clicking the result loads a mostly blank page with a few raw
   shortcode tags visible as plain text instead of rendered content.
4. The actual current pricing page, built in the new theme, also
   appears in the results, further down the list.

What's actually happening:
- BuilderTheme Pro's companion plugin registered its own custom
  post type (e.g. `builder_layout`) to store saved page layouts.
- WordPress's default search query includes any public post type by
  default unless a theme or plugin explicitly excludes it - so old
  `builder_layout` entries remain fully searchable even after the
  plugin that created and could render them is gone.
- The raw shortcode text renders as plain text because the
  shortcode was registered by the now-deleted plugin; WordPress
  has no other plugin left that knows what to do with it.</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix: Clean Up or Explicitly Exclude the Orphaned Post Type</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Check the Custom Post Type UI or a direct database query for any post type registered by a previous theme or plugin before deleting that plugin, and either export the content somewhere usable or delete the now-orphaned entries outright if they serve no purpose anymore.</li>
<li>Exclude a specific legacy post type from search results directly, using the pre_get_posts action to filter it out of the main query, as an immediate fix that doesn&#8217;t require touching the old data itself if you&#8217;re not ready to delete it yet.</li>
<li>Audit the site for any other custom post type left behind by a previous theme or plugin switch, since a search result pointing at dead content is usually just the most visible symptom of leftover data that can also affect sitemaps, RSS feeds, and internal link structures.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>A theme switch is correctly understood as a purely visual and template-level change, so there&#8217;s no obvious reason to suspect it could leave searchable database content behind &#8211; the mental model of &#8220;themes don&#8217;t touch content&#8221; is accurate for everything except a plugin&#8217;s own custom post type.</li>
<li>The broken result only surfaces when a visitor&#8217;s search term happens to match the old entry&#8217;s title or content specifically, so a site can run for months with the leftover data quietly sitting in the database before anyone&#8217;s search query actually surfaces it.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>Deactivating a theme removes its templates &#8211; it was never going to remove the content its companion plugin already wrote into your database.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— WordPress Admin</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/wordpress-fix-search-results-that-return-pages-from-a-theme-you-deactivated-months-ago/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Visual Studio: Fix a Test Project That Builds Fine Alone but Fails to Discover Any Tests After a NuGet Restore</title>
		<link>http://blog.ercanopak.com/visual-studio-fix-a-test-project-that-builds-fine-alone-but-fails-to-discover-any-tests-after-a-nuget-restore/</link>
					<comments>http://blog.ercanopak.com/visual-studio-fix-a-test-project-that-builds-fine-alone-but-fails-to-discover-any-tests-after-a-nuget-restore/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:31:40 +0000</pubDate>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[NuGet]]></category>
		<category><![CDATA[Test Explorer]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[visual studio]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/visual-studio-fix-a-test-project-that-builds-fine-alone-but-fails-to-discover-any-tests-after-a-nuget-restore/</guid>

					<description><![CDATA[🛠️ The Test Project That Built, and Then Found Nothing A test project depends on a specific test adapter package to let Visual Studio&#8217;s Test Explorer discover and run the tests it contains, and that adapter is resolved and loaded independently of whether the project itself compiles successfully &#8211; which means a restore that pulls [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #0f2027 0%, #203a43 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f6e0.png" alt="🛠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Test Project That Built, and Then Found Nothing</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>A test project depends on a specific test adapter package to let Visual Studio&#8217;s Test Explorer discover and run the tests it contains, and that adapter is resolved and loaded independently of whether the project itself compiles successfully &#8211; which means a restore that pulls in a slightly different, incompatible version of the test adapter, the test framework, or the shared SDK they both depend on can leave a project that builds completely cleanly with zero tests showing up anywhere in Test Explorer, no error reported, and no obvious link back to the restore that just ran moments earlier.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="text">1. Test project builds successfully - Build Succeeded, zero errors,
   zero warnings related to the test framework itself.
2. Test Explorer shows the test project listed, but with zero
   individual tests underneath it - no error icon, no red text,
   just an empty node where dozens of tests used to appear.
3. Recent action: ran a NuGet restore after pulling teammates'
   changes, which updated the test SDK package
   (Microsoft.NET.Test.Sdk) to a newer version, while the test
   adapter package (e.g. xunit.runner.visualstudio) stayed pinned
   at its previous version in this project's own file.
4. Output window, Tests category, shows a quiet warning about an
   adapter failing to load or a version mismatch - easy to miss
   entirely unless that specific output category is selected.

The build succeeds because the test SDK/adapter mismatch doesn't
actually break compilation - it only affects whether Test Explorer's
discovery process can successfully load and talk to the adapter at
runtime, which is a completely separate step from compiling the
project's code.</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix: Keep the Test SDK and Adapter Versions Moving Together</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Check the Output window&#8217;s Tests category specifically after any restore that touches a test project, since the actual warning about a failed or mismatched adapter load is usually sitting there in plain text, just in a pane most people never select unless they already suspect test discovery is broken.</li>
<li>Update the test framework&#8217;s adapter package to a version compatible with the test SDK version the restore just pulled in, rather than leaving one pinned while the other moves &#8211; the two are meant to be upgraded together, not independently.</li>
<li>Add a central package version management file, or explicitly pin both the test SDK and the adapter package together in the same place, so a future restore can&#8217;t silently update one without the other drifting out of a compatible version range.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>A successful build gives every visual signal that the project is in a healthy state, so there&#8217;s no natural reason to suspect the restore that just ran is actually the cause of a completely separate-seeming problem in Test Explorer a few minutes later.</li>
<li>Test Explorer showing an empty, test-free project looks identical whether the cause is an adapter version mismatch, a build configuration issue, or genuinely zero tests existing in that project &#8211; there&#8217;s no prominent error state to distinguish &#8220;broken discovery&#8221; from &#8220;nothing to discover.&#8221;</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>Compiling a test project and actually discovering its tests are two separate jobs &#8211; a restore can quietly break the second one while leaving the first looking perfectly fine.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— Developer Tip</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/visual-studio-fix-a-test-project-that-builds-fine-alone-but-fails-to-discover-any-tests-after-a-nuget-restore/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ASP.NET Core: Fix a File Upload That Times Out on Slow Connections Only Because Kestrel&#8217;s Minimum Data Rate Feature Kicked In</title>
		<link>http://blog.ercanopak.com/asp-net-core-fix-a-file-upload-that-times-out-on-slow-connections-only-because-kestrels-minimum-data-rate-feature-kicked-in/</link>
					<comments>http://blog.ercanopak.com/asp-net-core-fix-a-file-upload-that-times-out-on-slow-connections-only-because-kestrels-minimum-data-rate-feature-kicked-in/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:31:36 +0000</pubDate>
				<category><![CDATA[Asp.Net Core]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[ASP.NET Core]]></category>
		<category><![CDATA[File Upload]]></category>
		<category><![CDATA[kestrel]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/asp-net-core-fix-a-file-upload-that-times-out-on-slow-connections-only-because-kestrels-minimum-data-rate-feature-kicked-in/</guid>

					<description><![CDATA[⚙️ The Upload That Failed Only on the Slowest Connections Kestrel enforces a minimum data rate on both reading a request and writing a response, dropping the connection if a client sends or receives data more slowly than the configured floor for more than a short grace period &#8211; a safety feature meant to free [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #0f2027 0%, #203a43 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2699.png" alt="⚙" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Upload That Failed Only on the Slowest Connections</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>Kestrel enforces a minimum data rate on both reading a request and writing a response, dropping the connection if a client sends or receives data more slowly than the configured floor for more than a short grace period &#8211; a safety feature meant to free up server resources from a client that has effectively stalled. A large file upload from a genuinely slow or congested connection can trip that same floor well before the upload would have otherwise finished, aborting a transfer that a generous request body size limit and a generous request timeout both would have allowed to complete. The failure looks exactly like a generic connection reset to the client, with nothing in the client-visible error pointing at the server setting that actually caused it.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="csharp">// A generous size limit and request timeout both suggest this
// upload should be allowed to take its time:
builder.Services.Configure&lt;FormOptions&gt;(options =&gt;
{
    options.MultipartBodyLengthLimit = 500_000_000;
});
builder.Services.Configure&lt;KestrelServerOptions&gt;(options =&gt;
{
    options.Limits.MaxRequestBodySize = 500_000_000;
});

// But Kestrel's default minimum data rate still applies underneath
// both of those settings - a client sustaining less than roughly
// 240 bytes/second for more than a short grace period gets its
// connection aborted mid-upload, regardless of the body size limit
// or how generous any other timeout was configured to be:
//   MinRequestBodyDataRate: 240 bytes/sec, 5 second grace period
// (the actual Kestrel default, unless explicitly overridden)</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix: Set the Minimum Data Rate to Match What Slow Uploads Actually Need</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Override MinRequestBodyDataRate explicitly for the specific upload endpoint, lowering the bytes-per-second floor or disabling the check entirely for that route rather than for the whole application, once you know real clients upload from genuinely slow connections.</li>
<li>Reproduce the failure by actually throttling a test upload&#8217;s bandwidth to a realistic worst case, instead of relying on a fast local network connection where the minimum data rate floor is never remotely close to being tripped.</li>
<li>Log the specific exception Kestrel raises when it aborts a connection for falling below the minimum rate, since it is distinct from a generic timeout and immediately points at the correct setting instead of leaving the cause to be guessed at from a plain connection reset.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Every other timeout and size limit involved in the upload path can be configured generously and still not matter, because the minimum data rate check operates independently of all of them and enforces its own floor regardless of what the rest of the configuration allows.</li>
<li>The failure only reproduces on a connection slow enough to fall under the floor for long enough to trigger it, so testing on a typical office or home connection almost never reveals the problem &#8211; it surfaces only once real users on weak mobile or rural connections try the same upload.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>A generous size limit tells Kestrel how much data it will accept &#8211; the minimum data rate tells it how slowly it will accept that data, and the two settings answer completely different questions.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— Backend Architect</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/asp-net-core-fix-a-file-upload-that-times-out-on-slow-connections-only-because-kestrels-minimum-data-rate-feature-kicked-in/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>JavaScript: Fix an Array Destructuring Default Value That Silently Never Applies Because null Was Passed Instead of Undefined</title>
		<link>http://blog.ercanopak.com/javascript-fix-an-array-destructuring-default-value-that-silently-never-applies-because-null-was-passed-instead-of-undefined/</link>
					<comments>http://blog.ercanopak.com/javascript-fix-an-array-destructuring-default-value-that-silently-never-applies-because-null-was-passed-instead-of-undefined/#respond</comments>
		
		<dc:creator><![CDATA[ErcanOPAK]]></dc:creator>
		<pubDate>Sun, 04 Oct 2026 11:31:31 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Default Values]]></category>
		<category><![CDATA[Destructuring]]></category>
		<category><![CDATA[ES6]]></category>
		<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">http://blog.ercanopak.com/javascript-fix-an-array-destructuring-default-value-that-silently-never-applies-because-null-was-passed-instead-of-undefined/</guid>

					<description><![CDATA[⚡ The Default Value That Only Worked for One Kind of Missing A default value in a destructuring pattern only kicks in when the corresponding position is exactly undefined &#8211; not when it is missing from a shorter array, and specifically not when it is present but holds the value null, which JavaScript treats as [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style='background: linear-gradient(135deg, #232526 0%, #414345 100%); padding: 60px 50px; border-radius: 24px; margin: 40px 0 50px 0; box-shadow: 0 20px 60px rgba(0,0,0,0.3);'>
<h2 style='margin: 0 0 25px 0; font-size: 2.8em; font-weight: 800; color: white;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a1.png" alt="⚡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Default Value That Only Worked for One Kind of Missing</h2>
<p style='font-size: 1.4em; line-height: 1.6; margin: 0; color: #e0e0e0;'>A default value in a destructuring pattern only kicks in when the corresponding position is exactly undefined &#8211; not when it is missing from a shorter array, and specifically not when it is present but holds the value null, which JavaScript treats as a deliberate, distinct value rather than an absence of one. Code that destructures the result of a function which can return null for a field &#8211; a database lookup that found no match, or a parsed value that failed to parse &#8211; quietly skips every default value for that field, leaving null to flow forward into code that expected either a real value or the configured fallback, and getting neither.</p>
</div>
<div style='background: #f8fafc; padding: 35px; border-radius: 20px; margin: 30px 0; border: 1px solid #e2e8f0;'>
<h4 style='color: #1e293b; margin: 0 0 15px 0; font-size: 1.5em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50e.png" alt="🔎" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Problem</h4>
<pre class="EnlighterJSRAW" data-enlighter-language="javascript">function getUserPrefs(userId) {
    // theme comes back as null specifically when the user has no
    // saved preference row at all - not undefined, null:
    const row = lookupPrefsRow(userId);
    return [row ? row.theme : null, row ? row.fontSize : null];
}

const [theme = 'light', fontSize = 14] = getUserPrefs(42);

// Expected: theme === 'light', fontSize === 14, when there's no
// saved row. What actually happens: theme === null, fontSize ===
// null - the default values never apply, because null is not
// undefined, and a destructuring default only triggers for
// undefined specifically.

applyTheme(theme);      // called with null, not 'light'
setFontSize(fontSize);  // called with null, not 14</pre>
</div>
<div style='background: #d4edda; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #28a745;'>
<h4 style='color: #155724; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fix: Normalize to Undefined Before the Default Ever Has to Apply</h4>
<ul style='color: #155724; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>Convert a deliberate null into undefined at the source &#8211; right where the lookup can return null &#8211; before the value ever reaches a destructuring pattern, so the default value mechanism sees exactly the signal it actually checks for.</li>
<li>Use the nullish coalescing operator explicitly on each value instead of relying on a destructuring default when a value can be either null or undefined, since nullish coalescing treats both the same way and a destructuring default does not.</li>
<li>Add a direct equality check for null immediately after any API, parser, or database call known to return it for a missing value, and decide there &#8211; deliberately &#8211; whether the rest of the code should treat that null the same as undefined or differently.</li>
</ul>
</div>
<div style='background: #fff3cd; padding: 35px; border-radius: 20px; margin: 50px 0; border-left: 6px solid #ffc107;'>
<h4 style='color: #856404; margin: 0 0 20px 0; font-size: 1.7em; font-weight: 700;'><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why This Is Easy to Miss</h4>
<ul style='color: #856404; font-size: 1.1em; line-height: 2.2; margin: 0; padding-left: 25px;'>
<li>A destructuring default reads as a general catch-all for any kind of missing value, so it is a reasonable, common assumption that it covers null as well as undefined &#8211; the actual rule is narrower than the syntax visually suggests.</li>
<li>A quick manual test calling the function with a completely missing argument, rather than one that explicitly returns null, exercises the undefined case and shows the default working correctly, hiding the gap until a real null value happens to flow through.</li>
</ul>
</div>
<blockquote style='background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%); border-left: 8px solid #5c6bc0; padding: 45px; margin: 60px 0 30px 0; border-radius: 24px;'>
<p style='font-size: 1.4em; line-height: 1.7; margin: 0; color: #1a237e; font-style: italic; font-weight: 500;'>A destructuring default only answers to one specific value &#8211; null raises its hand just as clearly as any value does, and the default never hears it.</p>
<footer style='margin-top: 25px; color: #283593; font-size: 1em; font-weight: 600;'>— JavaScript Tip</footer>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://blog.ercanopak.com/javascript-fix-an-array-destructuring-default-value-that-silently-never-applies-because-null-was-passed-instead-of-undefined/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
