<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: lartuen</title>
    <description>The latest articles on DEV Community by lartuen (@lartuen).</description>
    <link>https://dev.to/lartuen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4203366%2Fa45c5d01-07b7-411b-9a73-30182a9fe0f6.png</url>
      <title>DEV Community: lartuen</title>
      <link>https://dev.to/lartuen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lartuen"/>
    <language>en</language>
    <item>
      <title>Our E2E tests keep getting stuck in the test setup. How would you approach this?</title>
      <dc:creator>lartuen</dc:creator>
      <pubDate>Fri, 27 Nov 2026 20:04:06 +0000</pubDate>
      <link>https://dev.to/lartuen/our-e2e-tests-keep-getting-stuck-in-the-test-setup-how-would-you-approach-this-1gln</link>
      <guid>https://dev.to/lartuen/our-e2e-tests-keep-getting-stuck-in-the-test-setup-how-would-you-approach-this-1gln</guid>
      <description>&lt;p&gt;I’m looking for a second opinion on our testing setup.&lt;/p&gt;

&lt;p&gt;We’re using Node.js ES modules, Playwright, PostgreSQL and Docker Compose. There are 125 integration/E2E tests across 12 groups, each running in its own container. Everything is local, with made-up accounts and data.&lt;/p&gt;

&lt;p&gt;Preparation checks keep passing, but attempts to run the full suite have exposed problems in the test infrastructure. Separate browser and migration checks have passed.&lt;/p&gt;

&lt;p&gt;The latest run stopped at the first command. Reviewing the code turned up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A circular import involving top-level await. Unit tests imported the code as a library, so they missed the actual command-line startup path.&lt;/li&gt;
&lt;li&gt;A recovery test expecting saved browser state that it never creates.&lt;/li&gt;
&lt;li&gt;A two-tab test that could pass even if the second tab does nothing.
That last one looks roughly like this:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;// Both tabs initially show "A".&lt;br&gt;
edit(tab1, "B");                  // Sends a save.&lt;br&gt;
select(tab2, "A");                // Helper skips it: already selected.&lt;br&gt;
assert(operationCount &amp;gt; before); // Tab 1 alone satisfies this.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is simplified pseudocode. The two browser-test issues were found by reading the code and haven’t been reproduced yet.&lt;/p&gt;

&lt;p&gt;We also have a database that has already been migrated, with recorded before/after checks. Our current plan says we can’t reset that database or reuse its test accounts. Those are rules we chose, and I’m open to questioning them.&lt;/p&gt;

&lt;p&gt;Would you run the whole suite against a separate disposable database first, using the real commands, browsers and migrations, then keep the existing database for checks that need its original history?&lt;/p&gt;

&lt;p&gt;What would you keep real in that rehearsal, and how would you check that tests aren’t passing for the wrong reasons?&lt;/p&gt;

&lt;p&gt;Any insight you can offer would be greatly appreciated! If there’s anything I’ve left out that would help, let me know. Thanks! 🐾&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>playwright</category>
      <category>node</category>
      <category>testing</category>
    </item>
    <item>
      <title>What stack would you choose for a matching platform?</title>
      <dc:creator>lartuen</dc:creator>
      <pubDate>Sun, 15 Nov 2026 02:18:10 +0000</pubDate>
      <link>https://dev.to/lartuen/what-stack-would-you-choose-for-a-matching-platform-1a4f</link>
      <guid>https://dev.to/lartuen/what-stack-would-you-choose-for-a-matching-platform-1a4f</guid>
      <description>&lt;p&gt;I’m working on a matching platform and considering Next.js, Tailwind CSS and Supabase/PostgreSQL. I’d like to hear from people who’ve built applications with similar technical requirements, particularly where this combination works well and where it starts to get awkward.&lt;/p&gt;

&lt;p&gt;It’s a web-first application with a fairly complex backend. The main requirements are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reliable editing and relational data.&lt;/strong&gt; Multi-step forms, autosave and resume across devices, with users potentially editing in multiple tabs. Some transactions affect several related records or users. Concurrent updates, retries and lost responses need to be handled without overwriting newer data or repeating an operation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Matching and search.&lt;/strong&gt; Deterministic, rules-based calculations rather than ML. Results need to track the versions of their inputs and rules, with recalculation when those change. Search includes filtering, pagination and geographical queries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Authentication.&lt;/strong&gt; Passwordless email sign-in, phone verification, account recovery and admin MFA. Verification codes need to remain single-use even when requests overlap. Revoked sessions and replaced codes must stop working.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Access control.&lt;/strong&gt; Permissions depend on account status, role, the relationship between users and its current state. They can differ for each participant, resource and field, with separate rights to read history, send messages, edit data or access shared files. Changes must take effect during active sessions and govern protected responses, cached content and queued work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Private media.&lt;/strong&gt; Upload validation, image processing and asynchronous content screening. Files remain access-controlled, and a delayed processing result must not replace a newer version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Messaging, jobs and integrations.&lt;/strong&gt; Private messaging, timely updates, notifications, payment integration and scheduled work. Jobs and webhooks need to cope with duplicate or out-of-order delivery, restarts and partial failures. Time-based access rules need to stay correct across timezones and daylight-saving changes, even if a scheduled job runs late.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Privacy and administration.&lt;/strong&gt; Scoped admin permissions, audit trails, aggregate reporting, retention rules, data export and deletion. Deletion and access changes also need to be accounted for in derived data, queues, external services and backup recovery.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’d prefer managed database, authentication and storage services where possible. I also want a straightforward way to test the complete stack locally and in staging, including concurrency and failure recovery. Safe migrations, monitoring and tested backups matter, and the application needs to behave correctly with multiple instances and workers.&lt;/p&gt;

&lt;p&gt;Would you choose Next.js and Supabase for this? Which parts would you handle within that setup, and where would you introduce a separate API, worker or service?&lt;/p&gt;

&lt;p&gt;If you’d choose a different stack, what makes it a better technical fit? I’m particularly interested in limitations or tradeoffs you’ve encountered in production.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>webdev</category>
      <category>architecture</category>
      <category>backend</category>
    </item>
    <item>
      <title>Web Locks and draft recovery: which browser edge cases am I missing?</title>
      <dc:creator>lartuen</dc:creator>
      <pubDate>Tue, 03 Nov 2026 01:24:47 +0000</pubDate>
      <link>https://dev.to/lartuen/web-locks-and-draft-recovery-which-browser-edge-cases-am-i-missing-5324</link>
      <guid>https://dev.to/lartuen/web-locks-and-draft-recovery-which-browser-edge-cases-am-i-missing-5324</guid>
      <description>&lt;p&gt;I’m building an onboarding flow for a web app and would appreciate a sanity check on recovering unsaved form drafts across browser tabs! &lt;/p&gt;

&lt;p&gt;The backend is authoritative for committed answers. In the browser, &lt;code&gt;localStorage&lt;/code&gt; holds recovery records, while &lt;code&gt;sessionStorage&lt;/code&gt; holds a pointer to that tab’s draft slot.&lt;/p&gt;

&lt;p&gt;We use an exclusive Web Lock for each slot. If another live tab holds the lock, the new tab gets a separate slot. The owner keeps its lock while its context can write; ending that context stops further writes and releases ownership.&lt;/p&gt;

&lt;p&gt;A controlled test exposed a race:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tab B reads the snapshot belonging to Tab A.&lt;/li&gt;
&lt;li&gt;Before B acquires the lock, A stores a newer draft and ends its context.&lt;/li&gt;
&lt;li&gt;B acquires the released lock.&lt;/li&gt;
&lt;li&gt;B restores its earlier snapshot and overwrites A’s final draft.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ownership was exclusive, but the snapshot had been read too early.&lt;/p&gt;

&lt;p&gt;This reproduction used native Node Web Locks, in-memory storage and a deliberately delayed lock request. It establishes the adapter’s stale-read path; I’d like to strengthen the browser lifecycle coverage too.&lt;/p&gt;

&lt;p&gt;The proposed correction is to acquire ownership &lt;strong&gt;before rereading and validating the current snapshot&lt;/strong&gt;, then restore it while retaining the lock. If the current recovery records cannot be verified, preserve their bytes and allow inspection without writes.&lt;/p&gt;

&lt;p&gt;The behaviours we want to preserve are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An ordinary reload recovers the tab’s draft.&lt;/li&gt;
&lt;li&gt;A duplicated tab cannot overwrite the original tab’s recovery slot.&lt;/li&gt;
&lt;li&gt;Recovering a pending server operation never automatically resubmits it.&lt;/li&gt;
&lt;li&gt;Where Web Locks are unavailable, an existing pointed slot stays read-only.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;For people who have shipped something similar:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Does holding the lock for the lifetime of the writable context introduce lifecycle problems we should account for? I’m particularly interested in back/forward cache restoration, suspended tabs, crashes and rapid sign-out/sign-in.&lt;/p&gt;

&lt;p&gt;Which concrete failure scenarios would you turn into regression tests before trusting this approach?**&lt;/p&gt;

&lt;p&gt;Examples of what broke your first implementation would be especially useful. :)&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>discuss</category>
      <category>webdev</category>
      <category>testing</category>
    </item>
    <item>
      <title>How should session revocation affect requests already in flight?</title>
      <dc:creator>lartuen</dc:creator>
      <pubDate>Sun, 01 Nov 2026 01:12:10 +0000</pubDate>
      <link>https://dev.to/lartuen/how-should-session-revocation-affect-requests-already-in-flight-1b63</link>
      <guid>https://dev.to/lartuen/how-should-session-revocation-affect-requests-already-in-flight-1b63</guid>
      <description>&lt;p&gt;&lt;strong&gt;How do you handle session revocation while a request is still in flight?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’m working on a Node.js and PostgreSQL web app and reviewing its access controls before moving a local prototype to Linux hosting. The requests involve sensitive form data.&lt;/p&gt;

&lt;p&gt;The case I’m trying to handle is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A user submits a save.&lt;/li&gt;
&lt;li&gt;Their access is revoked while the request is still running.&lt;/li&gt;
&lt;li&gt;The database transaction or its response is still pending.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The current design separates stopping new work from recording that the session has ended:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the server applies the cutoff, it refuses new work and stops further sensitive response writes to the socket.&lt;/li&gt;
&lt;li&gt;A transaction that received a single-use, transaction-specific commit permit before the cutoff may still commit before the session’s end is durably recorded. Simply receiving a request before the cutoff is insufficient.&lt;/li&gt;
&lt;li&gt;Bytes already handed to the operating system or a proxy may still reach the browser afterward. We’re not trying to recall those.&lt;/li&gt;
&lt;li&gt;If a save commits but its response is lost, that uncertainty must be resolved without blindly repeating the save.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The prototype uses a native Rust/rustls component to control commit permissions and socket writes. Before investing in porting that layer, I want to understand whether the requirement justifies the complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How would you enforce this cutoff using a conventional Node/PostgreSQL architecture behind a reverse proxy?&lt;/strong&gt; In particular, where would you enforce the response-write guarantee, and what limitations would remain?&lt;/p&gt;

&lt;p&gt;I’m also open to questioning the requirement itself. Examples from systems you’ve operated would be especially helpful.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI assistance. Project is real and in progress, so please let me know if anything needs clarification.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>architecture</category>
      <category>node</category>
      <category>security</category>
    </item>
    <item>
      <title>One email code, two simultaneous requests: which providers prevent double redemption?</title>
      <dc:creator>lartuen</dc:creator>
      <pubDate>Fri, 23 Oct 2026 20:22:21 +0000</pubDate>
      <link>https://dev.to/lartuen/typed-email-otp-which-managed-implementations-prevent-concurrent-reuse-3pm8</link>
      <guid>https://dev.to/lartuen/typed-email-otp-which-managed-implementations-prevent-concurrent-reuse-3pm8</guid>
      <description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;I’m evaluating managed authentication while retaining Supabase for the database. Users should type an emailed one-time code rather than follow a magic link.&lt;/p&gt;

&lt;p&gt;The requirement is at most one successful redemption of each issued proof, including overlapping submissions. For example, two simultaneous verification requests using the same issued OTP must not create two independent sessions.&lt;/p&gt;

&lt;p&gt;This is not a one-session-per-user rule: later independently authorized sign-ins and multiple sessions are allowed. A safely authorized retry returning the proven original result is also different from a second redemption creating another independent session.&lt;/p&gt;

&lt;p&gt;Does anyone have firsthand implementation experience or public provider documentation establishing this behaviour for Supabase Auth, Amazon Cognito, Clerk, Auth0, or another supported managed approach?&lt;/p&gt;

&lt;p&gt;My current understanding is that generic “single-use” wording and rejection of sequential reuse do not, on their own, establish concurrency safety. Missing documentation is an evidence gap, not proof that a provider is defective. Please correct that understanding or point out any supported approaches I’ve overlooked.&lt;/p&gt;

&lt;p&gt;Specifics about the authentication flow, required configuration, and whether the behaviour is supported and enabled in the managed service would be especially helpful.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: AI assisted with the research and drafting of this question. I’m seeking firsthand human experience, corrections, and verifiable sources.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>authentication</category>
      <category>security</category>
      <category>supabase</category>
    </item>
  </channel>
</rss>
