SShortSingh.
Back to feed

Developer drops Spatie team mode for multi-tenancy due to silent data corruption risk

0
·1 views

A developer building a Multi-Tenant Starter project initially adopted Spatie's built-in team mode from the laravel-permission package to scope user roles per tenant. The approach requires a team_id column as part of a composite primary key in the model_has_roles table, meaning every role assignment must have a non-null team_id. Because users in the project can be assigned application roles before joining any team, the required default value of 1 caused role assignments to silently attach to whichever team holds ID 1, without throwing any error. This silent data corruption — where a user gains permissions in a team they never joined — was deemed more dangerous than an outright failure. The developer ultimately abandoned Spatie's team mode entirely rather than patch around the constraint or restructure the primary key.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Builds Local SQLite Retrieval Layer to Feed Relevant Memory to LLMs

A developer working on a local-first AI system has implemented a search and retrieval layer that connects a SQLite-based memory store to a large language model's prompt window. The system uses keyword search functions with SQLite's LIKE operator to perform case-insensitive lookups across stored memory titles and content, with support for filtering by context type. Results are ranked by importance and recency using database-level ordering and limits, ensuring only the most relevant records are fetched without loading unnecessary data into memory. A dedicated function then formats the raw database records into structured text blocks that help the LLM clearly distinguish between different memory entries. Timing tests showed the entire retrieval and formatting process completes in milliseconds, confirming the local approach adds no noticeable delay to the user experience.

0
ProgrammingDEV Community ·

HTML-First Form Rebuild Doubled Completion Rates After React App Failed in 3 Days

A regulated utility company struggled with a broken service application form after two costly rebuilds failed, including a React app that was pulled offline within three days due to accessibility issues and a flawed localStorage-based file upload system. A developer rebuilt the form from scratch using Astro, an HTML-first framework that ships zero JavaScript by default, adding JavaScript only as a progressive enhancement. The new form was designed to work on any device, on poor connections, and without JavaScript ever being a prerequisite for completing a task. When the rebuilt form launched, the rate of users successfully completing it doubled. The project illustrates that lightweight, server-rendered HTML can outperform heavy single-page applications for public-facing utility tasks where broad accessibility is essential.

0
ProgrammingHacker News ·

QuadRF Device Detects Drones and Maps WiFi Signals Through Walls

A radio frequency tool called QuadRF has demonstrated the ability to detect nearby drones and visualize WiFi signals penetrating through walls. The technology was explored and documented by Jeff Geerling on his personal blog in 2026. QuadRF appears to leverage RF scanning capabilities to identify wireless transmissions across multiple frequency bands. The device's ability to passively sense drone RF signatures and household WiFi activity highlights its potential for both security monitoring and RF environment analysis.

0
ProgrammingDEV Community ·

A Night Sky Analogy That Explains How Large Language Models Actually Work

A developer and writer on DEV Community has proposed a new analogy for understanding large language models, comparing their internal semantic spaces to galaxies in the night sky. In the analogy, each galaxy represents a region of linguistic meaning, and a user's prompt acts as both a directional pointer and an entry point into that space. The author previously tried a dictionary analogy but found it inadequate, as dictionaries provide surface-level definitions rather than the relational, contextual patterns that allow LLMs to generate coherent text. Within any given semantic region, the possible combinations and navigational paths are described as practically infinite, despite the model's vocabulary being technically bounded. Two key factors — temperature and context — are identified as the primary forces shaping how a model moves through that semantic space, with temperature governing how far the model "hops" between probable next tokens.

Developer drops Spatie team mode for multi-tenancy due to silent data corruption risk · ShortSingh