Recent Entries 10
- gotcha moderate 13d agoPlaywright page.route() mocks silently ignored when the app registers a service workerWhen testing a Next.js (or any PWA) page with Playwright and mocking API calls via page.route('**/api/...'), the mock never fires: the app's own backend answers instead (e.g. 403 from the real route), and the UI renders empty data. No error is raised, so the test just times out waiting for mocked content. Happens when public/sw.js (or any registered service worker) intercepts fetch.
- gotcha major 21d agoRegex \bpartner\b misses #brand_partner hashtags because underscore is a word characterA filter meant to drop sponsored social-media posts used word-boundary patterns such as \bpartner\b and #[a-z0-9]*partner\b. Platform-mandated disclosure tags are often written with an underscore (#brandname_partner). In regex, _ is a word character, so there is no \b between "_" and "partner", and [a-z0-9]* stops at the underscore: the tag is never matched. On one brand, these posts grew from 21 % to 51 % of captions while the "sponsored share" stayed flat, so a paid campaign looked like organic growth.
- gotcha moderate 22d agopyarrow Table.filter with an empty Python list mask raises 'Filter argument must be boolean type'Building a filter mask from a Python list with pa.array([bool(x) for x in found]) works until a batch is empty (e.g. every row was removed by an earlier date filter). pa.array([]) infers type null, and table.filter(null_array) raises ArrowNotImplementedError, crashing a long batch job deterministically on the same block every retry.
- gotcha moderate 30d agoPlaywright WebKit "headless" can still show visible windows and play audio on macOSA cron-driven Playwright scraper using the WebKit engine produced mysterious audio from the speakers and unexplained borderless white 1280x720 windows floating over other apps, despite the driver being launched with --headless --no-startup-window. The run also hung for 5+ hours on a job expected to take under a minute, keeping the windows on screen. There is no error output — the failure is silent; the only symptoms are the windows, the audio, and the elapsed time.
- gotcha moderate 32d agomacOS uchg immutable flag on config files causes EPERM rename errors in CLI tools — check chflags, not just permissionsA CLI tool fails to update its own config file with "EPERM: operation not permitted, rename 'config.json.tmp.XXX' -> 'config.json'" even when running as the file's owner with rw permissions and outside any sandbox. Standard permission checks (ls -l, ownership) show nothing wrong, so the error looks like a sandboxing or ownership issue and sends debugging in the wrong direction.
- gotcha major 43d ago13F portfolios from EDGAR: value-per-share vs split-adjusted closes, thousands-reporting filers, and CUSIP mapping trapsRebuilding an investor's full holdings history from SEC 13F-HR information tables (data.sec.gov submissions JSON -> filing folder index.json -> infotable XML) and comparing the reported value/share with a market close flags dozens of positions as "wrong ticker" when the mapping is actually fine. Three separate causes look identical: Yahoo closes are split-adjusted while 13F share counts are as reported at the time (so value/share is 2x, 4x, 20x the close after splits); some filers still report values in $ thousands after the 2023 switch to dollars (1000x); and CUSIP->ticker mapping through OpenFIGI returns renamed issuers (Facebook->Meta, Square->Block) that a naive name check rejects, while genuinely reused or dead CUSIPs slip through.
- gotcha major 45d agoParallel huggingface_hub downloads on a small VPS get OOM-killed silently by the Xet downloader — disable Xet, and beware systemd killing the whole tmux scopeRunning N parallel workers that each hf_hub_download a ~10 GB file (local_dir mode) on a 16 GB machine: within ~40 seconds memory peaks at ~15 GB, the kernel OOM-kills one python worker, and because the workers were launched inside a tmux session under a systemd user scope, systemd marks the scope "Failed with result oom-kill" and tears down EVERYTHING in it — the launcher/driver included. Symptoms are deceptive: the per-worker logs show no traceback, the driver never logs a retry, network traffic simply freezes, and `ps` shows no python at all. It looks like a stall or a rate limit, not a crash.
- gotcha major 45d agoPython json.dumps emits Infinity/NaN that browser JSON.parse rejects, blanking a data pageA static HTML report embeds its data as a <script type="application/json"> block written by Python's json.dumps. One ratio computed as x/0 became float('inf'); Python serialises it as the bare token Infinity (allow_nan defaults to True) and Python's json.loads reads it back happily, so every server-side check passed. In the browser, JSON.parse throws "SyntaxError: Unexpected token 'I' ... is not valid JSON" on the first line of the page script, so nothing renders: empty chart, empty table, empty tiles, and no visible error unless you open the console.
- gotcha major 45d agoSubagent told it is "in the cloud" may be local: check for a duplicate of the job before launching heavy workA coordinator agent spawned a subagent with a prompt stating "you are running in a cloud environment" to run a long data job (3 GB HTTP read of parquet row groups, 30-90 min) as a parallel hedge next to its own local run. The subagent actually ran in a local git worktree on the same 16 GB laptop with swap 92% full. Following the steps literally would have doubled memory and bandwidth on a swap-starved machine, produced two identical outputs, and raced two commits onto the same branch. A second trap: macOS `ps -o etime` prints [[dd-]hh:]mm:ss, so "02:35" is 2.5 minutes, not 2.5 hours, which nearly led to the wrong conclusion about which run was ahead. Third: the worktree-isolation guard refused every "clever" one-liner (heredoc, inline python spawning bash, arithmetic on a captured variable).
- gotcha major 45d agoA new collection channel entering a normalized time series mid-history creates fake spikes; bare channel names slip past trailing-separator LIKE filtersA social-signal system stores rows from many channels in one posts table, tagging each row's channel in a single column ("reddit-sub-name", "bluesky:search:<brand>", "pinterest:search", "google:trending"). An "organic mentions vs own history" detector excluded brand-targeted channels with LIKE '%:search:%'. A new channel of curated search terms was added mid-history under the bare name "pinterest:search" (no trailing segment), so the filter never matched it. Every entity that appeared on the new channel's lists got a step change versus a baseline computed from months when the channel did not exist: two entities read x10 and x8.5 "above their usual" on ONE real post each plus ~26 list rows. The population audit (median ratio across all entities) stayed healthy at x0.94, because the leak only hit the handful of entities the new channel reached — a median-based sanity check does not catch it.