Latest Updates

Documenting code, one commit at a time.

Localizing the Breniapp: From Session to User Database

The Breniapp project aims to streamline [description]. Recently, we tackled an issue with the locale switcher that was causing inconsistencies in how user locales were being handled.

The Problem

Previously, the locale selected by a user was only being saved in the session and a cookie. This approach relied on a two-step redirect chain through a LocaleController.

Read more

Improving Job Reliability with Time-Based Retries in Landing

In the landing project, we've been focusing on improving the reliability of background jobs, especially when dealing with rate limiting and throttling exceptions. Previously, we used a fixed number of retry attempts, but this approach proved to be problematic.

The Problem

When jobs are released back to the queue due to rate limiting or throttling middleware, each release counted towards the

Read more

Mitigating Session Logout Issues After User Impersonation

Introduction

Have you ever experienced a user being unexpectedly logged out immediately after being impersonated? This issue often stems from inconsistencies in session data following authentication switches. Let's explore how to address this in a PHP-based platform.

The Problem: Stale Session Password Hashes

In many web applications, especially those employing middleware for

Read more

Global Impersonation: Fixing a Routing Glitch in a Laravel Platform

Working on the Reimpact platform, we encountered a routing issue that prevented the 'stop impersonation' feature from working consistently across all panels. This post details the problem and the solution implemented to ensure global functionality.

The Problem

The impersonation.stop route was not always accessible because the RouteServiceProvider responsible for registering it wasn't

Read more

Improving Application Stability and User Experience in Landing

The devlog-ist/landing project focuses on creating a smooth and reliable user experience. Recent work has addressed several critical production errors to enhance stability and prevent disruptions.

Addressing Production Errors

Production errors can significantly impact user satisfaction and overall application performance. A proactive approach to identifying and resolving these issues is

Read more

Multi-Tenancy in Laravel with PostgreSQL Schemas: A Migration Story

Introduction

Row-level filtering is common for multi-tenancy, but what if you need stronger isolation? At Reimpact's platform, we're migrating towards PostgreSQL schemas to achieve true tenant separation, leveraging Laravel, Filament, and the middleware pattern.

This post details our approach to dynamically setting the PostgreSQL search_path for each tenant, ensuring data isolation and

Read more

Skipping Session Validation Middleware During Impersonation in Platform

The Problem

In the Reimpact platform, we encountered an issue where session validation middleware was causing unexpected logouts during user impersonation. Specifically, the CheckValidSession and EnsureSingleSession middlewares were interfering with the impersonation process, leading to a frustrating user experience.

The Cause

The root cause of the problem lies in how the session is

Read more

Streamlining Onboarding with Middleware Bypass Logic

Introduction

Imagine a scenario where specific user roles within an application are needlessly subjected to onboarding processes designed for different user groups. This post explores how to selectively bypass middleware to optimize the user experience for marketing admins in the 'landing' project.

The Problem: Unnecessary Onboarding Steps

In many applications, middleware is used to

Read more

Validating Livewire Requests with Middleware in the Platform Project

In the Reimpact/platform project, a recent update addresses an issue where Livewire update requests were being incorrectly blocked by a custom middleware. This post details the problem and the solution implemented.

The Problem

The ValidationUserMiddleware was designed to handle user authentication and validation for incoming requests. However, it was inadvertently blocking unauthenticated

Read more