Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Day: November 17, 2026

Ajax

Ajax: Fix an AbortController Signal Not Cancelling a Pending Fetch

- 17.11.26 - ErcanOPAK comment on Ajax: Fix an AbortController Signal Not Cancelling a Pending Fetch

πŸ”„ Ajax: Fix an AbortController Signal Not Cancelling a Pending Fetch Calling controller.abort() reliably stops the page from waiting on a fetch() promise, but that’s a client-side promise rejection, not a guarantee that the underlying network request actually stops β€” if a service worker intercepted the original request in its own fetch event handler and […]

Read More
C#

C#: Fix a Lazy Initializer Running Twice Under Thread Contention

- 17.11.26 - ErcanOPAK comment on C#: Fix a Lazy Initializer Running Twice Under Thread Contention

πŸ”§ C#: Fix a Lazy Initializer Running Twice Under Thread Contention Lazy<T> constructed with LazyThreadSafetyMode.PublicationOnly explicitly allows its factory delegate to run more than once under thread contention β€” multiple threads racing to initialize are each allowed to execute the factory concurrently, and whichever result finishes first is the one that gets published, with every […]

Read More
JavaScript

JavaScript: Fix a WeakMap Losing Entries After a Structured Clone

- 17.11.26 - ErcanOPAK comment on JavaScript: Fix a WeakMap Losing Entries After a Structured Clone

⚑ JavaScript: Fix a WeakMap Losing Entries After a Structured Clone A WeakMap only ever matches a key by strict object reference, which is exactly what makes it silently break the moment an object crosses a structuredClone() boundary β€” passing data to a Web Worker through postMessage(), or cloning it directly β€” because structured cloning […]

Read More
Wordpress

WordPress: Fix a Shortcode Rendering Twice Inside the Block Editor

- 17.11.26 - ErcanOPAK comment on WordPress: Fix a Shortcode Rendering Twice Inside the Block Editor

πŸ“ WordPress: Fix a Shortcode Rendering Twice Inside the Block Editor A classic shortcode registered through add_shortcode() can appear to render itself twice inside the Block Editor’s live preview even though the published front end only shows it once, because a page builder panel or preview sidebar that calls do_shortcode($content) on its own copy of […]

Read More
Photoshop

Photoshop: Fix Export As Washing Out Colors in a Wide-Gamut Document

- 17.11.26 - ErcanOPAK comment on Photoshop: Fix Export As Washing Out Colors in a Wide-Gamut Document

πŸ–ŒοΈ Photoshop: Fix Export As Washing Out Colors in a Wide-Gamut Document A document built in Adobe RGB or ProPhoto RGB can look rich and saturated inside Photoshop’s own color-managed canvas, then come out of File > Export As looking flat and washed out the moment it’s opened in a browser or shared on a […]

Read More
Photoshop

Photoshop: Fix a Smart Object Resetting Its Filters After Re-Linking

- 17.11.26 - ErcanOPAK comment on Photoshop: Fix a Smart Object Resetting Its Filters After Re-Linking

πŸ–ŒοΈ Photoshop: Fix a Smart Object Resetting Its Filters After Re-Linking Relinking a Smart Object β€” pointing it at an updated source file through Layer > Smart Objects > Replace Contents β€” is meant to swap the pixels while leaving every Smart Filter above it untouched, but when the new source file has different pixel […]

Read More
Docker

Docker: Fix a Multi-Stage Build Caching a Stale npm Install Layer

- 17.11.26 - ErcanOPAK comment on Docker: Fix a Multi-Stage Build Caching a Stale npm Install Layer

🐳 Docker: Fix a Multi-Stage Build Caching a Stale npm Install Layer The standard pattern of copying package.json before the rest of the source so npm install can be cached as its own layer only works if every file that actually determines what gets installed is part of that early COPY β€” and it’s an […]

Read More
Git

Git: Fix a Worktree Losing Track of a Branch After a Rename

- 17.11.26 - ErcanOPAK comment on Git: Fix a Worktree Losing Track of a Branch After a Rename

πŸ”€ Git: Fix a Worktree Losing Track of a Branch After a Rename Each git worktree keeps its own administrative files under .git/worktrees/<name>/, including a HEAD pointer to the branch it has checked out, and renaming a branch with git branch -m old new from a DIFFERENT worktree than the one that actually has it […]

Read More
C#

C#: Fix an IAsyncEnumerable Silently Not Disposing Its Enumerator

- 17.11.26 - ErcanOPAK comment on C#: Fix an IAsyncEnumerable Silently Not Disposing Its Enumerator

πŸ”§ C#: Fix an IAsyncEnumerable Silently Not Disposing Its Enumerator await foreach automatically calls DisposeAsync() on an IAsyncEnumerable<T>‘s enumerator when the loop ends, which is exactly what makes manual enumeration via GetAsyncEnumerator() β€” common when hand-writing a custom wrapper or a LINQ-like extension method instead of reaching for await foreach directly β€” so easy to […]

Read More
Asp.Net Core

Asp.Net Core: Fix a Background Service Swallowing Startup Exceptions

- 17.11.26 - ErcanOPAK comment on Asp.Net Core: Fix a Background Service Swallowing Startup Exceptions

βš™οΈ Asp.Net Core: Fix a Background Service Swallowing Startup Exceptions The base BackgroundService class’s own StartAsync kicks off ExecuteAsync and returns immediately without awaiting it to completion, storing the running task internally instead β€” which means an exception thrown early in ExecuteAsync, even before its first await, lands in a faulted Task that nothing in […]

Read More
Kubernetes

Kubernetes: Fix a CronJob Silently Skipping Runs After a Time Change

- 17.11.26 - ErcanOPAK comment on Kubernetes: Fix a CronJob Silently Skipping Runs After a Time Change

☸️ Kubernetes: Fix a CronJob Silently Skipping Runs After a Time Change The CronJob controller decides whether a run was ‘missed’ by comparing the schedule against .status.lastScheduleTime and the controller’s own clock, and if that comparison turns up more than 100 missed start times in a row β€” which a sudden clock jump, an NTP […]

Read More
CSS

CSS: Fix a Sticky Header Jittering During Momentum Scroll on iOS

- 17.11.26 - ErcanOPAK comment on CSS: Fix a Sticky Header Jittering During Momentum Scroll on iOS

🎨 CSS: Fix a Sticky Header Jittering During Momentum Scroll on iOS A position: sticky header that looks rock-solid on desktop can visibly jitter or flicker during iOS Safari’s momentum scrolling, especially once a backdrop-filter blur is involved, because the browser’s compositor has to repaint that blurred layer on nearly every scroll frame instead of […]

Read More
Windows

Windows 11: Fix File Explorer Losing Saved Folder View Settings

- 17.11.26 - ErcanOPAK comment on Windows 11: Fix File Explorer Losing Saved Folder View Settings

πŸͺŸ Windows 11: Fix File Explorer Losing Saved Folder View Settings Every folder’s individual view settings β€” Details vs. large icons, column widths, sort order β€” are stored in the registry under ShellNoRoam\Bags, keyed by a hash tied to that folder’s path, but that whole store is capped by a BagMRU Size limit (400 entries […]

Read More
Git

Git: Fix a Bisect Session Stuck Skipping the Same Commit Forever

- 17.11.26 - ErcanOPAK comment on Git: Fix a Bisect Session Stuck Skipping the Same Commit Forever

πŸ”€ Git: Fix a Bisect Session Stuck Skipping the Same Commit Forever git bisect skip is meant for the occasional untestable commit, but if an entire sub-range of the remaining candidates is untestable β€” because an unrelated infrastructure break, not the bug you’re actually hunting, affected every commit in that window β€” the bisect algorithm’s […]

Read More
AI

The AI Prompt That Rewrites a Flaky Test Into a Deterministic One

- 17.11.26 - ErcanOPAK comment on The AI Prompt That Rewrites a Flaky Test Into a Deterministic One

πŸ€– The AI Prompt That Rewrites a Flaky Test Into a Deterministic One A test that fails roughly one run in twenty is almost always hiding a real timing assumption, shared mutable state, or an unseeded source of randomness rather than a genuinely intermittent bug, and tracking that assumption down by eye across setup code, […]

Read More
Visual Studio

Visual Studio: Fix IntelliSense Still Showing a Downgraded NuGet API

- 17.11.26 - ErcanOPAK comment on Visual Studio: Fix IntelliSense Still Showing a Downgraded NuGet API

πŸ› οΈ Visual Studio: Fix IntelliSense Still Showing a Downgraded NuGet API Downgrading a NuGet package (reverting from v8 back to v6, say, to dodge a breaking change) often leaves IntelliSense still completing members from the newer API long after the restore finishes, because the Roslyn workspace that drives completion caches its view of each referenced […]

Read More
HTML

HTML5: Fix a details Element Losing Its Open State After a Form Reset

- 17.11.26 - ErcanOPAK comment on HTML5: Fix a details Element Losing Its Open State After a Form Reset

🧩 HTML5: Fix a details Element Losing Its Open State After a Form Reset Setting a <details> element’s open property from script works fine until that element lives inside a <form> that gets reset β€” a type=”reset” button, or a browser restoring form state from the back-forward cache, only reliably preserves disclosure state that the […]

Read More
AI

The AI Prompt That Turns a Gym Routine Into a Printable Weekly Log

- 17.11.26 - ErcanOPAK comment on The AI Prompt That Turns a Gym Routine Into a Printable Weekly Log

πŸ€– The AI Prompt That Turns a Gym Routine Into a Printable Weekly Log A workout plan written as a loose paragraph or a screenshot of someone else’s routine is hard to actually use at the gym, because you end up rebuilding it into a checklist in your head every single session instead of once […]

Read More
SQL

SQL Server: Fix a Merge Statement Double-Counting Matched Rows

- 17.11.26 - ErcanOPAK comment on SQL Server: Fix a Merge Statement Double-Counting Matched Rows

πŸ—„οΈ SQL Server: Fix a Merge Statement Double-Counting Matched Rows The actual row modifications a MERGE statement performs are correct even under a parallel execution plan, but Microsoft’s own documentation calls out a specific, narrower gotcha: when a parallel plan is chosen for a MERGE that also uses the OUTPUT clause, that clause can return […]

Read More
AI

The AI Prompt That Explains Why a Null Check Got Skipped in Review

- 17.11.26 - ErcanOPAK comment on The AI Prompt That Explains Why a Null Check Got Skipped in Review

πŸ€– The AI Prompt That Explains Why a Null Check Got Skipped in Review A missing null check that makes it past review usually isn’t a case of nobody looking β€” it’s a case of the check looking unnecessary given everything visible in that one file, because the actual guarantee (or lack of one) lives […]

Read More
Wordpress

WordPress: Fix the Media Library Showing Dead Thumbs After an S3 Move

- 17.11.26 - ErcanOPAK comment on WordPress: Fix the Media Library Showing Dead Thumbs After an S3 Move

πŸ“ WordPress: Fix the Media Library Showing Dead Thumbs After an S3 Move Moving uploads to S3 through an offload plugin rewrites the attachment’s primary URL correctly, but the wp-admin Media Library grid doesn’t read that top-level URL for its thumbnails β€” it reads the per-size file paths stored inside the serialized _wp_attachment_metadata postmeta, and […]

Read More
Asp.Net Core

Asp.Net Core: Fix a Minimal API Route Matching the Wrong Overload

- 17.11.26 - ErcanOPAK comment on Asp.Net Core: Fix a Minimal API Route Matching the Wrong Overload

βš™οΈ Asp.Net Core: Fix a Minimal API Route Matching the Wrong Overload Minimal API routing generally favors a literal path segment over a parameterized one, but that preference only kicks in reliably when the parameterized segment carries an explicit route constraint β€” a bare {id} with no type constraint can, depending on registration order and […]

Read More
Windows

Windows 11: Fix Bluetooth Audio Stuttering Right After Waking Up

- 17.11.26 - ErcanOPAK comment on Windows 11: Fix Bluetooth Audio Stuttering Right After Waking Up

πŸͺŸ Windows 11: Fix Bluetooth Audio Stuttering Right After Waking Up Bluetooth audio that stutters for the first several seconds after waking a PC from sleep, then runs perfectly smoothly afterward, usually comes down to the Bluetooth radio’s own power management: with Allow the computer to turn off this device to save power enabled on […]

Read More
SQL

SQL Server: Fix an Identity Column Gap After a Failed Bulk Insert

- 17.11.26 - ErcanOPAK comment on SQL Server: Fix an Identity Column Gap After a Failed Bulk Insert

πŸ—„οΈ SQL Server: Fix an Identity Column Gap After a Failed Bulk Insert An IDENTITY column’s next value is allocated the moment a row is attempted, not committed, so a bulk insert that fails partway through β€” or a whole transaction that gets rolled back after identity values were already handed out β€” leaves a […]

Read More
C#

C#: Fix a Record’s with Expression Not Cloning a Nested Collection

- 17.11.26 - ErcanOPAK comment on C#: Fix a Record’s with Expression Not Cloning a Nested Collection

πŸ”§ C#: Fix a Record’s with Expression Not Cloning a Nested Collection A record’s with expression produces a new instance by copying every field’s current value, but for a reference-type member like a List<T>, the ‘value’ being copied is the reference itself, not the list’s contents β€” so a record you just created with with […]

Read More
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,056)
  • Get the User Name and Domain Name from an Email Address in SQL (982)
  • How to add default value for Entity Framework migrations for DateTime and Bool (980)
  • Get the First and Last Word from a String or Sentence in SQL (859)
  • How to select distinct rows in a datatable in C# (856)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (657)
  • Add Constraint to SQL Table to ensure email contains @ (612)
  • Average of all values in a column that are not zero in SQL (570)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (548)
  • Find numbers with more than two decimal places in SQL (477)

Recent Posts

  • HTML5: Fix a datalist Suggestion List Not Filtering as You Type
  • WordPress: Fix a Custom Field Resetting After Every Autosave
  • Docker: Fix a Healthcheck Marking a Container Unhealthy Too Soon
  • Windows 11: Fix Voice Typing Placing Punctuation in the Wrong Spot
  • Git: Fix a Stash Pop Conflicting With Unrelated Untracked Files
  • Photoshop: Fix the History Brush Reverting Past a Resize Step
  • SQL Server: Fix a View Returning Stale Data After a Schema Change
  • CSS: Fix an aspect-ratio Box Collapsing When Content Overflows
  • Photoshop: Fix the Color Picker Clamping a Custom Swatch’s Hue
  • JavaScript: Fix Array.sort Reordering Equal Items Unexpectedly

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,056)
  • Get the User Name and Domain Name from an Email Address in SQL (982)
  • How to add default value for Entity Framework migrations for DateTime and Bool (980)
  • Get the First and Last Word from a String or Sentence in SQL (859)
  • How to select distinct rows in a datatable in C# (856)

Recent Posts

  • HTML5: Fix a datalist Suggestion List Not Filtering as You Type
  • WordPress: Fix a Custom Field Resetting After Every Autosave
  • Docker: Fix a Healthcheck Marking a Container Unhealthy Too Soon
  • Windows 11: Fix Voice Typing Placing Punctuation in the Wrong Spot
  • Git: Fix a Stash Pop Conflicting With Unrelated Untracked Files

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com