Painel de Notícias

Tecnologia

7045 posts · 26 feeds · tópicos e interesse por Jev

Filtros
dev.to

Your agent's memory fails silently. CortHeXis 2.0 is the part that notices.

Your coding agent's memory does not fail loudly. It fails the way a slow leak does: the agent just knows a little less every week, and you blame the model. I've been running my company's products through Claude Code sessions for five months, with a memory of short markdown notes behind them — 417 notes today, about 440,000 words, every one written while actually shipping something. Over that time I kept a list of every way that memory broke. Not one of them raised an error. Today we're releasing CortHeXis 2.0, the engine that came out of that list. It's open source (Apache-2.0), it runs alone next to any agent that speaks MCP, and it's the same code that runs our own memory. This post is about the failures first, because they are the product. 1. The memory server vanished for nine days. A tool rewrote our project's .mcp.json to add a browser server, and dropped the memory server in the process. Every session kept working. None of them could search the memory. Agents started answering from an index file that had been truncated to fit the context window. It took nine days to notice — because nothing was wrong, things were just worse. 2. One colon broke recall for a note. A note whose description: contains an unquoted : is invalid YAML. The indexer skipped its header, the note lost its description, and with it the few words the search was matching on. It still existed. It was just never found again. 3. A ghost note. A session appended a fact with cat >> pricing_rules.md while the note was called pricing-rules.md. A new file appeared, with no header, carrying a corrected fact — while the old note kept the wrong one. Two truths, and the search happily returned the stale one. 4. A better model made recall worse. We switched embeddings from MiniLM to EmbeddingGemma and recall jumped on our bench. But the hook that injects notes at every message kept the score threshold I had tuned "by eye" for the old model. Measured afterwards: it was injecting the right note in 22 % of c

IADev
Interesse
dev.to

What happens when you paste JSON into an online formatter

In November 2025, researchers at watchTowr Labs published findings about two popular online formatters — JSONFormatter and CodeBeautify. According to that research, users who used those sites' Save features left shareable copies of their pastes on the services' servers. Both sites also exposed a "Recent Links" page that listed saved items. watchTowr reported collecting 80,000+ saved JSON submissions — about five years of JSONFormatter history and one year of CodeBeautify data, described as 5GB+ of enriched content. After parsing that dataset, they said it included credentials, keys, configuration data, and personally identifiable information. They also planted canary credentials and later observed those canaries being tested, writing that someone else was already scraping the same sources. That research is nearly a year old. Site features and exposure can change. This article does not claim either named site leaks data today. It explains the pattern watchTowr described, how to check any tool yourself, and how Tool Reign's JSON tools behave in our own code. Formatting JSON in the browser can stay local. The risk rises when a tool offers Save or a shareable link that stores your paste on a server. According to watchTowr, those shareable URLs followed predictable patterns, and Recent Links pages made saved entries browsable. Once text sits on someone else's server behind a guessable or listable URL, anyone who finds the link can read it — including automated scrapers. The lesson is general: if a button uploads or persists your paste for later retrieval, treat that paste as public unless you have strong evidence otherwise. You can verify any site in a few minutes. Use harmless test data only — never real secrets. Open the tool in a private/incognito window. Open DevTools → Network. Enable Preserve log. Filter by Fetch/XHR. Paste a unique, harmless string (for example a fake key you invent for this test). Click Format, Beautify, Save, Share, or whatever actions the page

SegurançaDev
Interesse
dev.to

Giving every agent the full context is why your reasoning degrades — the context engineering pattern that fixes it — Context Engineering

I spent two months convinced my agents had a reasoning problem. They contradicted each other, repeated work, and confidently cited facts that nobody had established. I upgraded models. I rewrote prompts. I added a knowledge graph because the research said graphs were the future. Each fix bought me a week of calm before the same failures crept back. The turning point came when I stopped asking "why are my agents wrong?" and started asking a harder question: "what are they actually seeing?" That's when I found it. My agents weren't bad at reasoning. They were reasoning over polluted contexts, and I had been the one polluting them. I'd built a research pipeline with five agents: scout, analyst, synthesizer, fact-checker, and writer. Each agent received the full accumulated context of everything that had come before. Sources read. Conclusions drawn. Draft sections. Intermediate tool outputs. The entire history, passed forward in one growing blob because that's what the tutorials showed. The first sign was subtle. The analyst would repeat a conclusion the scout had already established, phrasing it as a new discovery. The second sign was louder. The writer would confidently assert a fact that appeared nowhere in the source material—but which had been hinted at in an intermediate note the fact-checker had already flagged as unverified. I kept looking for a reasoning bug. What I found was a context bug. The research had already named what I was experiencing. Context rot — the measurable degradation in LLM output quality as input length increases — was formalized by Chroma's 2025 research, which tested 18 frontier models and found that every single one gets worse as input grows. Not some. Not most. All of them. Even when the context window isn't close to full. The numbers are brutal. Chroma found 20–50% performance drops as input length grew from 10k to 100k+ tokens, with coherent documents paradoxically degrading performance more than shuffled ones. Reasoning-capable models

IADev
Interesse
dev.to

Why Your PolyCopy App Needs a Circuit Breaker for LLM APIs

Introduction When a Polymarket copy‑trading tool like PolyCopy relies on large language model (LLM) APIs for signal generation, order sizing, or leaderboard commentary, it inherits the same volatility and failure modes as any external service. Network hiccups, rate‑limit throttling, or sudden model deprecation can cascade into broken user experiences, inaccurate paper‑mode results, and even corrupted leaderboard data. A circuit breaker pattern shields your app from these shocks, keeping the copy‑trading experience reliable and trustworthy. A circuit breaker is a lightweight state machine that monitors calls to an upstream dependency—in this case, the LLM API. It has three states: Closed – calls flow normally. Errors are counted. Open – after a configurable error threshold is hit, the breaker trips and immediately returns a fallback response without calling the API. Half‑Open – after a cool‑down period the breaker allows a limited number of trial calls to see if the service has recovered. If the trial calls succeed, the breaker resets to Closed; otherwise it returns to Open. Failure Scenario Impact Without a Breaker How the Breaker Helps Rate‑limit exhaustion – the LLM API returns 429 Users see delayed or missing trade recommendations; paper‑mode scores become stale. The breaker stops further requests, returns a cached recommendation or a polite “try again later” message, preserving UI responsiveness. Model version deprecation – API schema changes Parsing errors corrupt leaderboard entries, potentially breaking the verification logic. The half‑open state lets you test the new schema before fully re‑enabling calls, giving you time to update adapters. Network outage – intermittent timeouts Repeated retries block the event loop, causing the entire server to stall. The open state instantly short‑circuits the call, allowing the rest of the app (order queue, user auth) to continue. Unexpected payload – malformed JSON from the provider Bad data propagates into the copy‑trad

DevIA
Interesse
Phoronix

Linux 7.4 Continues Preparing For Intel's Rugged Panther Lake

Back in May we spotted a Linux patch adding "Panther Lake R" as a rugged version of Panther Lake intended for "use in harsh environments". Since Linux 7.2 we have seen some bits of Panther Lake R driver support added while for the upcoming Linux 7.4 cycle there is additional enablement happening for this Panther Lake derivative...

LinuxInfra
Interesse
dev.to

Getting Scanned Documents Under Portal Size Limits (On Your Phone)

You finally finished scanning your certificates. The portal says “Upload PDF (max 200 KB)”—or 500 KB, 1 MB, 2 MB—and your file is 4.8 MB. Or it accepts the size but rejects the upload because pages are in the wrong order, the file is password-protected, or each photo is a separate attachment when they wanted one merged PDF. This guide is for that moment. It focuses on phone-first workflows: using what you already have (Camera, Files, Photos) plus a browser converter when you need merge, reorder, page size, and compression without installing a heavy desktop app. These are the failure modes that show up again and again on admission, scholarship, KYC, and job portals. Most upload rules boil down to a handful of checks: File type — almost always PDF (sometimes JPG only for a photo field). Maximum size — commonly somewhere between about 100 KB and 2 MB for document packs; photo fields may be smaller. Page size / dimensions — A4 is common for multi-page sets; ID slots may want a specific aspect. Page count and order — e.g. application form first, then ID, then certificates. No password / no encryption — locked PDFs often fail silently. Readable text or clear scan — blurry phone photos get human rejection even when size is fine. If you only shrink the file but ignore order or clarity, you can still get rejected. Compression cannot invent detail that was never in the photo. Light: Face a window or use even indoor light; avoid harsh flash glare on glossy certificates. Angle: Shoot straight-on; skewed pages waste pixels on background and look unprofessional. Fill the frame: Crop clutter in your gallery app before converting. One page per shot unless the portal explicitly wants a single photo of a spread. Prefer the document scanner mode in Google Drive, Microsoft Lens, Adobe Scan, or your phone’s built-in scanner if you have it—these flatten perspective better than a casual Camera roll shot. Save or export as clear JPG/PNG first. You will turn them into PDF next. Portals that

Mobile
Interesse
Hacker News

Apple and a Hacker's Future

Article URL: https://stratechery.com/2026/apple-and-a-hackers-future/ Comments URL: https://news.ycombinator.com/item?id=49962857 Points: 5 # Comments: 0

GeralMobile
Interesse
Phoronix

Qualcomm Patching Linux For Hardware Thermal Binning To Benefit Snapdragon X Laptops

A new patch series sent out from Qualcomm that aims to help at least the Snapdragon X series laptops is hardware-binned trip point support. Some Qualcomm SoCs are available in different multiple thermal/package bins with different junction temperature limits but otherwise being the same silicon. The new Linux patches are working to properly convey that information around the thermal limits for a given piece of silicon...

LinuxInfraMobile
Interesse
The Verge

Our minds aren’t equipped to handle AI

Norbert Wiener, godfather of cybernetics, once said, "The thought of every age is reflected in its technique." For the past century, our thought has been reflected in our computers, including by those in the AI industry. Google's Demis Hassabis calls the brain "a biological approximation to a Turing machine." Elon Musk puts it more bluntly, declaring that "people should just think of the brain as a biological computer." (Musk's brain often worries me.) But humans are more complex than a straightforward comparison to computers gives us credit for - and far more than most of the AI industry seems to appreciate. And as their products push e … Read the full story at The Verge.

IA
Interesse
dev.to

Monitoring AI coding agent costs and activity on your own machine

I run Claude Code, Cursor, Codex and a handful of sub-agents on my own machines every day. For a long time, I knew what they cost but had little visibility into their work. If an agent felt slow or got stuck, I had to dig through separate logs to understand why. That became harder as I started using several agents on the same project. Each kept its own session history, and there was no single place to review the activity. We built AgentMon to monitor agents across a company. AgentMon Start brings that visibility to a desktop app for individual developers and teams. I’m part of the team behind AgentMon. This post explains how Start collects data and what you can inspect after installation. AgentMon Start reads the session logs your coding agents already write. It supports more than 16 agents, harnesses and LLMs, including Claude Code, Claude Desktop, Codex, GitHub Copilot, Cursor, Gemini CLI and Goose. There is no SDK to add to your project or proxy to configure. The app has three local components: A collector that parses agent logs into snapshots of token usage, costs, tool calls, errors and security findings. A local server that stores those snapshots in SQLite and analyzes them. A desktop dashboard for viewing the results. The local server listens on 127.0.0.1. Closing the dashboard leaves collection running in the background. The Overview shows spending alongside session counts, token usage and cache hit rate. You can inspect the last 24 hours, seven days, 30 days or all recorded activity. The useful question is usually more specific than “How much did I spend?” Which session used the budget? Which model was running? Did an agent spend time retrying the same operation? The dashboard lets you move from the total to the sessions behind it. The hourly chart helps you locate a burst of activity, while the model breakdown shows how spending was distributed. Sessions groups activity into threads representing continuous work on a repository. Each thread shows the agent,

IADev
Interesse
dev.to

Autoscaling doesn't save you at 30,000 requests per second — your dependencies do

There's a comfortable story about peak traffic: load goes up, the autoscaler notices, pods multiply, everyone keeps their evening. I've watched that story hold, and I've watched it fail in a specific and instructive way — the autoscaler worked perfectly and the platform degraded anyway. Running transaction paths at sustained peaks in the tens of thousands of requests per second teaches you that horizontal scaling is the easy half of the problem. The hard half is that everything your new pods talk to did not scale, and now there are more of them asking. Scale-up triggers. Pods go from 12 to 40 in about ninety seconds. Each one opens its configured pool of 20 database connections on startup. The database's connection limit is 500. Twelve pods needed 240 connections and everything was fine. Forty pods want 800. The database starts refusing connections, the pods that can't connect fail their readiness probes, the orchestrator restarts them, they try to connect again, and you have built a very efficient machine for denying yourself service. The autoscaler, meanwhile, sees rising latency and scales up further. The dashboards looked bizarre: CPU low, memory low, replica count healthy, error rate vertical. Autoscaling converts a capacity problem into a concurrency problem on whatever you depend on. If that dependency is a fixed-size resource — a connection limit, a license seat count, a rate-limited upstream, a legacy system with a thread pool — scaling out makes things worse, not better, and it does so fast. The fix is to stop thinking about per-pod configuration and start thinking about a global budget: pool_size_per_pod × max_replicas ≤ dependency_limit × safety_factor With a 500-connection database, 0.8 safety factor (leave headroom for migrations, admin sessions, the other service nobody told you about), and a 40-replica ceiling: pool_size ≤ (500 × 0.8) / 40 = 10 Then pin both halves so neither drifts: apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler spec: minR

InfraDev
Interesse
dev.to

What If an AI Could Answer a Legal Question Based on the Law That Existed At That Time?

What If an AI Could Answer a Legal Question Based on the Law That Existed At That Time? I've been working on a research project called Indian Constitution Temporal QA, and it started with a question that sounds simple: Can an AI answer a question about the Indian Constitution while taking the date of the question into account? Most question-answering systems treat a document as if it is static. Legal documents aren't. The Indian Constitution has been amended repeatedly. Articles can change, provisions can be inserted, modified, or removed, and the version of the law that applies can depend on when you're asking the question. That creates a problem for AI systems. An answer can look completely correct today while being wrong for a question about what the Constitution said 20, 30, or 50 years ago. So instead of building another general-purpose legal chatbot, I'm trying to build a system that understands time as part of the question. The project is a dataset and retrieval pipeline for temporal question answering over the Indian Constitution. The goal is to track constitutional provisions across amendments and eventually answer questions such as: "What did Article X provide before the relevant amendment?" or "Which constitutional provision was applicable in a particular year?" The system needs to do more than retrieve a paragraph containing the right keywords. It needs to determine: What was the relevant provision? Which amendment changed it? When did that change take effect? Which version should be used for the question being asked? That's where the temporal part comes in. A normal RAG system might retrieve the latest version of a constitutional article and confidently generate an answer. But for historical legal questions, the latest version may be exactly the wrong evidence. That's the failure mode I'm interested in. I want to explore whether adding amendment history and temporal metadata can make retrieval more reliable for questions where the answer depends on a sp

IA
Interesse
dev.to

A cache key ate 99.9% of my records and the pipeline looked green

The worst pipeline bug I've shipped didn't throw. No stack trace, no failed job, no alert. Every run went green, finished inside its window, and wrote roughly one record out of every thousand it was handed. The job's own metrics said it was healthy, because the job's own metrics counted runs, not rows. It took a business user asking why a campaign list looked short to surface it. This post is about that class of bug — the pipeline that succeeds at doing nothing — and the three habits that make it structurally impossible rather than merely unlikely. Simplified, the stage looked like this. Records arrive in batches, get enriched against a reference lookup, and are staged before reconciliation downstream. // the bug, reduced String cacheKey = record.getAccountId(); Enrichment e = cache.get(cacheKey); if (e == null) { e = lookupService.fetch(record); cache.put(cacheKey, e); } stage(record, e); Spot it? accountId isn't unique per record. One account generates many records per batch — different products, different billing cycles, different dates. The key collapsed thousands of distinct records onto a handful of cache entries, and the downstream staging write was keyed off the same value. Last write wins. Everything else evaporated. The job processed every record. It just persisted almost none of them. The fix is one line, and the one line is not the lesson: String cacheKey = String.join("|", record.getAccountId(), record.getProductCode(), record.getBillingCycle(), record.getRecordDate().toString()); The lesson is that nothing in the system was capable of noticing. That's the actual defect. A pipeline stage should know how many records it received and how many it emitted, and should refuse to call itself successful when those numbers disagree in a way nobody authorised. @dataclass class StageResult: stage: str received: int emitted: int rejected: int reason_counts: dict[str, int] def assert_sane(self, min_ratio: float = 0.95) -> None: if self.received == 0: return accounte

Dev
Interesse
dev.to

How I built a credit-based AI website builder with FastAPI and Gemini

AI website builders are everywhere right now. But almost all of them are platforms you rent: the users, the brand and the pricing belong to someone else. Talivo. In this post I'll walk through the architecture and the decisions behind it. The code snippets are simplified to show the ideas, but the patterns are the ones that matter. Try the live demo (bring a free Gemini key; the first load takes ~30s while the free server wakes up). The goal: Why FastAPI + Gemini Step 1: Generating a full website from a prompt from google import genai client = genai.Client(api_key=GEMINI_API_KEY) SYSTEM_PROMPT = """You are an expert web designer. Return ONE complete, self-contained HTML document. - Inline all CSS in a tag. No external files. - Modern, responsive layout that works on mobile. - Realistic copy based on the user's request (no lorem ipsum). - Output ONLY the HTML. No markdown, no explanations.""" def generate_site(prompt: str) -> str: response = client.models.generate_content( model=GEMINI_MODEL, # e.g. a current Flash model from AI Studio contents=prompt, config={"system_instruction": SYSTEM_PROMPT}, ) return clean_html(response.text) Even with a strict prompt, models sometimes wrap the output in a code fence anyway. So the HTML always goes through a small cleanup step: import re def clean_html(text: str) -> str: text = text.strip() # strip ``` {% endraw %} html ... {% raw %} ``` fences if the model added them text = re.sub(r"^``` (?:html)?\s*|\s* ```$", "", text) if " 0: user.credits -= 1 save(user) Two quick requests from the same user can both read credits = 1, both pass the check, and you've given away a free generation. The fix is to make the check and the decrement one atomic database operation: def spend_credit(db, user_id: int) -> bool: cur = db.execute( "UPDATE users SET credits = credits - 1 " "WHERE id = ? AND credits > 0", (user_id,), ) db.commit() return cur.rowcount == 1 # False = no credits left If rowcount is 0, the user had no credits, and nothing chang

IADev
Interesse
dev.to

My First Open-Source Contribution

I’m excited to share that I’ve made my first contribution to freeCodeCamp! 🎉 My contribution was to the Python v9 curriculum, specifically the Kitchen Inventory Tracker workshop. I worked on Issue #70475, which pointed out incorrect Python terminology in Step 2 of the workshop. The instructions referred to check_kitchen_stock() as a function name and said that Python would “throw a syntax error.” While these may seem like small wording issues, they matter in an educational project where thousands of learners rely on the documentation to build the right mental models. I submitted PR #70539, where I corrected the terminology: Changed check_kitchen_stock() to check_kitchen_stock when referring to the function itself. Changed “throw a syntax error” to “raise a SyntaxError,” which is the appropriate Python terminology. The PR was reviewed, approved, and eventually merged into the main branch. Seeing the maintainer’s message congratulating me on my first contribution made the experience even more rewarding. 🙌 What I found most valuable wasn't just making the change. It was understanding how an open-source project works in practice — finding an issue, understanding the repository and contribution guidelines, making a focused change, checking the result, responding to feedback, and going through the review and merge process. This contribution also reminded me that open source isn't always about writing hundreds of lines of code. Sometimes, a one-line change can improve the learning experience for thousands of people if it fixes something that matters. This is only my first contribution, but it has given me a much better understanding of what it means to contribute to a real-world codebase. I'm looking forward to making more contributions, learning from maintainers, and becoming more comfortable working with open-source projects. Thank you to the freeCodeCamp community and maintainers for making the contribution process welcoming! ❤️ 🔗 PR: https://github.com/freeCodeCamp/

Dev
Interesse
dev.to

Day 3 of Building Crowdwide: Teaching Users a Feature Is Surprisingly Hard

It has been 3 days since I launched Crowdwide, and even though the platform is still very small, I’ve already learned something I didn't really expect: Building a feature is sometimes easier than getting users to actually use it. Here are the current numbers: 6 members 13 posts shared 3 communities These numbers are obviously tiny compared to established platforms, but for me, these first users are valuable because I can actually observe how people interact with something I built. And that's where I noticed this problem. Before Crowdwide, I built Rizzzler, a link-in-bio platform. You can create your own page for free, without ads or promotional requirements. One of the features I added was the ability to add custom music to your page. I documented the feature and even shared my own page as an example because I thought it looked pretty cool. There are currently 10+ users, but only 2 of them are using the custom music feature. Everyone else mostly uses the normal built-in music. My first reaction was basically: "Why isn't anyone using this? I literally built it for you." 😂 Then Crowdwide started teaching me the same lesson. A lot of the features I build aren't completely random. I get ideas from other products I use, problems I personally experience, and things I think could work differently in my own projects. For example, the community map in Crowdwide was inspired by Obsidian. I liked the idea of visually seeing connections and information instead of everything being presented as a simple list. So I thought: "What if communities could have their own locations and we could see communities from around the world on a map?" 🌍 That's how the idea for the Crowdwide community map started. It's not a direct copy of Obsidian's feature. I simply took an idea I found interesting and adapted the concept to a completely different use case. And currently, the map has basically one resident: My own community. 😂 So much for seeing the whole world. I've added quite a few things:

Geral
Interesse
dev.to

The boring part of an AI agent is the part that works

Most of the time an incident spends "being worked on" isn't work. It's waiting to reach someone who can act on it. An alert fires, an email lands in a shared inbox, somebody skims it, guesses which team owns it, forwards it, and that team decides it isn't theirs. On a bad night that loop costs you an hour before anyone has opened a terminal. I built an agent to collapse that loop for a BSS platform, and it took mean time to resolution on routed incidents from around two hours to about ten minutes. What surprised me is how little of that came from the language model. The model does one small job in the middle. Everything that makes the system trustworthy is plumbing. This post is about the plumbing. Incoming incident email is semi-structured in the worst way: there's a template, three systems ignore it, two append their own stack traces, and the one that matters most sends plain prose from a human. Regex gets you maybe 60% of the way and then rots every time an upstream team edits their alert body. That 40% tail is exactly where an LLM earns its place. But "classify this email" is not the system. The system is: poll inbox → normalise → classify → resolve owner → create ticket → notify → observe The model is step three. Steps one, two, four, five, six and seven decide whether anyone trusts it. The single highest-leverage thing I did was aggressively strip the email before the model ever saw it. Signatures, legal footers, quoted reply chains, base64 inline images, and the forty lines of Received: headers are pure token cost and pure distraction. import re from email import policy from email.parser import BytesParser QUOTE_MARKERS = ( "-----Original Message-----", "From:", "On ... wrote:", ) def extract_body(raw: bytes) -> str: msg = BytesParser(policy=policy.default).parsebytes(raw) part = msg.get_body(preferencelist=("plain", "html")) text = part.get_content() if part else "" # cut the reply chain at the first quote marker for marker in QUOTE_MARKERS: idx = text.find(

IAInfraDev
Interesse
dev.to

How a cached 301 put our homepage in a redirect loop (CloudFront + WordPress)

One morning our marketing site's homepage started failing with ERR_TOO_MANY_REDIRECTS. Every other page was fine. The cause turned out to be a perfectly reasonable cache setting meeting a perfectly reasonable SEO plugin. Here's the chain, because it's an easy one to walk into. 1. The SEO plugin strips tracking parameters. Our WordPress site (bytephase.com) uses Yoast, which can 301-redirect /?fbclid=abc or /?utm_source=x to the clean URL /. That's good for duplicate-URL hygiene. 2. The CDN ignores tracking parameters in the cache key. In CloudFront we excluded utm_*, gclid, fbclid and msclkid from the cache policy. Otherwise every ad click creates a fresh cache entry and a cache miss. Also good. A visitor arrives at /?fbclid=abc. CloudFront drops fbclid from the cache key, so the request maps to the cache entry for /. But the origin request policy still forwards fbclid to WordPress. WordPress sees the parameter and answers 301 → /. CloudFront caches that 301… under the key for /. The next visitor requests /, gets the cached 301 → /, follows it, and gets the same 301. Loop. The homepage was the only victim because it's where ad and social traffic lands. The cache key and the origin request must agree on which parameters exist. If CloudFront ignores a parameter for caching, it must also not forward it to the origin. We switched the origin request policy from "all viewer query strings" to all except the same list the cache policy excludes: utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_id, gclid, fbclid, msclkid Now WordPress never sees fbclid, so it never issues the redirect, and nothing poisonous gets cached. Analytics still works, because GA reads the parameters client-side from the browser URL, not from the server. Then we invalidated /*. Your browser caches 301s too. After the edge was fixed, Chrome kept looping from its own redirect cache. Test with a fresh profile, or fetch(url, {cache: 'reload'}), before declaring it still broken. The loop can

InfraDev
Interesse
dev.to

Database-per-tenant in Laravel: 6 lessons from running a multi-tenant SaaS

We build BytePhase, repair shop management software used by 2,000+ repair businesses in 32+ countries. Every customer account gets its own database. Here's what that choice taught us. None of it is exotic, but most of it we learned the hard way. Laravel + stancl/tenancy, database-per-tenant mode. One central database holds tenant metadata, subscriptions and plans. Each tenant gets a tenant_{id} database with ~120 tables: tickets, invoices, inventory, customers and so on. Tenants are identified by subdomain. The pitch for database-per-tenant is isolation: a missing WHERE tenant_id = ? can't leak one shop's customers into another shop's screen, because the other shop's rows aren't in the database at all. That holds. The cost moves elsewhere. An HTTP request finds its tenant from the subdomain. A queued job doesn't: by the time a worker picks it up, there's no request at all. The rule we now enforce everywhere: public function handle(): void { tenancy()->initialize($this->tenantId); // ... the actual work } Pass the tenant id into the job's constructor, initialise tenancy first in handle(), and never rely on "whatever tenant was active when this was dispatched". Without this, a job can run against the wrong database, or the central one, and nothing tells you. Redis doesn't know about your tenants. Cache::remember('settings', ...) in tenant A, then the same key in tenant B, and B sees A's settings. stancl/tenancy can prefix cache tags per tenant, but any hand-rolled key (rate limiters, locks, Cache::forever calls in a service class) has to include the tenant id. We treat a cache key without a tenant prefix as a bug in code review. Our customers asked for something database-per-tenant doesn't give you for free: several billing identities inside one account. One owner might run two shops with different tax numbers, logos, invoice number series and bank details, while sharing staff and customers. So inside each tenant there's a second level, a business: The frontend sends

Dev
Interesse
dev.to

The Framework Nobody Wrote Down: Taking a Backbone App to React

Backbone gave you models, views, a router and events, and left the rest to you. So most Backbone apps carry a homegrown framework on top: a global singleton, an event bus, a navigation controller, view cleanup code, a template build step and a drawer of jQuery plugins. Moving to React is mostly about finding that framework and deciding what replaces it. This guide covers how to run Backbone and React side by side, let React read Backbone models, turn views into components, test an app that never had tests, and delete the code that only existed to keep Backbone tidy. Backbone never tried to be a full framework. It gave you models, collections, views, a router and events, and then it left the rest to you. How views get cleaned up, how one part of the app talks to another, where navigation lives, how templates get built: your team decided all of that. Or, quite often, someone who left the company years ago did. That's why leaving Backbone feels different from leaving other frameworks. You aren't really moving off Backbone. You're moving off the framework your team built on top of it, and nobody ever wrote that one down. The good news is that a lot of it can simply be deleted, because React already does those jobs for you. The real work is finding it all first. Source code: the examples in this post come from a small GitHub viewer we built with Backbone 1.0, RequireJS, jQuery Mobile and Handlebars. On a desktop its views sit side by side as panels, and on a phone each one becomes its own page. We rebuilt it in React 18 with the same screens, element ids and API calls. You can find both versions at cobuild-tech/migratex-examples. The app was small, so we simply rewrote it. For bigger apps, we move step by step, and that's the approach this post describes. Nobody we talk to is upset with Backbone. It did exactly what it promised. Teams leave because of everything that grew up around it. RequireJS, Handlebars 1.x and old jQuery plugins have gone quiet, and in our example,

Dev
Interesse
dev.to

How I Added a Pre-Filled WhatsApp Button to Every Client Website in Delhi - With Code

How to Add a Pre-Filled WhatsApp Button to a Website with HTML, JavaScript & React If you build websites for businesses in India, you've probably noticed something: Many customers would rather send a WhatsApp message than fill out a contact form. For local businesses, especially service-based businesses, WhatsApp can be a much more natural conversion channel than asking someone to fill in their name, email address, phone number, and a long enquiry form. When I build websites for clients in Delhi and across India, one simple feature I often add is a WhatsApp click-to-chat button with a pre-filled message. The implementation is surprisingly simple. You don't need a WhatsApp API, a complicated backend, or an npm package. You can do it with a normal link and a little URL encoding. Here's how. A WhatsApp click-to-chat URL follows this structure: https://wa.me/PHONE_NUMBER?text=YOUR_ENCODED_MESSAGE For example: WhatsApp Us That's enough to create a basic WhatsApp CTA. When a visitor clicks the link, WhatsApp opens with the specified phone number and the pre-filled message. The phone number should be in international format. Don't include: + spaces brackets hyphens For example: +91 98765 43210 becomes: 919876543210 So the final URL becomes: https://wa.me/919876543210 A generic button might say: WhatsApp Us That's fine, but you can reduce friction even further by giving the visitor a starting message. For example: Hi, I found your website and would like to know more about your website development services. For a real estate website: Hi, I found this property on your website and would like to know more about it. For a salon: Hi, I'd like to book an appointment. Could you please share your available times? For a restaurant: Hi, I'd like to know more about today's menu and availability. The visitor can still edit the message before sending it. The purpose isn't to automate the entire conversation. The purpose is to make starting the conversation easier. This is where JavaScrip

Dev
Interesse